mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
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/202507041645.afjl5rssvrgu@alvherre.pgsql
This commit is contained in:
@@ -1239,12 +1239,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);
|
||||
|
||||
Reference in New Issue
Block a user