diff options
author | Álvaro Herrera | 2025-07-04 19:30:05 +0000 |
---|---|---|
committer | Álvaro Herrera | 2025-07-04 19:30:05 +0000 |
commit | f943e2339f6c13730367ed826f0c496a00953a3e (patch) | |
tree | 6bd724ddf39961be315ee226415df878c638ee59 | |
parent | f63e408e894c855775d1bd3224890cb618fd3894 (diff) |
Fix new pg_upgrade query not to rely on regnamespace
That was invented in 9.5, and pg_upgrade claims to support back to 9.0.
But we don't need that with a simple query change, tested by Tom Lane.
Discussion: https://postgr.es/m/[email protected]
-rw-r--r-- | src/bin/pg_upgrade/check.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index ed03fcecbca..0aee919c44a 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -1136,12 +1136,13 @@ check_for_not_null_inheritance(ClusterInfo *cluster) PGconn *conn = connectToServer(&old_cluster, active_db->db_name); res = executeQueryOrDie(conn, - "SELECT cc.relnamespace::pg_catalog.regnamespace AS nspname, " - " cc.relname, ac.attname " + "SELECT nspname, cc.relname, ac.attname " "FROM pg_catalog.pg_inherits i, pg_catalog.pg_attribute ac, " - " pg_catalog.pg_attribute ap, pg_catalog.pg_class cc " + " pg_catalog.pg_attribute ap, pg_catalog.pg_class cc, " + " pg_catalog.pg_namespace nc " "WHERE cc.oid = ac.attrelid AND i.inhrelid = ac.attrelid " " AND i.inhparent = ap.attrelid AND ac.attname = ap.attname " + " AND cc.relnamespace = nc.oid " " AND ap.attnum > 0 and ap.attnotnull AND NOT ac.attnotnull"); ntup = PQntuples(res); |