1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

In pg_upgrade, avoid dumping orphaned temporary tables. This makes the

pg_upgrade schema matching pattern match pg_dump/pg_dumpall.

Fix for 9.0, 9.1, and 9.2.
This commit is contained in:
Bruce Momjian
2011-08-15 22:39:31 -04:00
parent 5845f42721
commit 2411fbdac4
2 changed files with 12 additions and 6 deletions

View File

@ -59,7 +59,8 @@ old_8_3_check_for_name_data_type_usage(ClusterInfo *cluster)
" NOT a.attisdropped AND "
" a.atttypid = 'pg_catalog.name'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
" n.nspname != 'pg_catalog' AND "
/* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
" n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
ntups = PQntuples(res);
@ -148,7 +149,8 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
" NOT a.attisdropped AND "
" a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
" n.nspname != 'pg_catalog' AND "
/* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
" n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
ntups = PQntuples(res);
@ -245,7 +247,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
" NOT a.attisdropped AND "
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
" n.nspname != 'pg_catalog' AND "
/* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
" n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
/*
@ -263,7 +266,7 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
" NOT a.attisdropped AND " \
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
" c.relnamespace = n.oid AND " \
" n.nspname != 'pg_catalog' AND " \
" n.nspname !~ '^pg_' AND " \
" n.nspname != 'information_schema') "
ntups = PQntuples(res);
@ -616,7 +619,8 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
" pg_catalog.pg_namespace n "
"WHERE c.relkind = 'S' AND "
" c.relnamespace = n.oid AND "
" n.nspname != 'pg_catalog' AND "
/* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
" n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
ntups = PQntuples(res);