mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +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:
@ -1689,12 +1689,13 @@ check_for_not_null_inheritance(ClusterInfo *cluster)
|
||||
log_opts.basedir,
|
||||
"not_null_inconsistent_columns.txt");
|
||||
|
||||
query = "SELECT cc.relnamespace::pg_catalog.regnamespace AS nspname, "
|
||||
" cc.relname, ac.attname "
|
||||
query = "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";
|
||||
|
||||
task = upgrade_task_create();
|
||||
|
Reference in New Issue
Block a user