aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-11-26 17:00:43 -0800
committerAndres Freund <andres@anarazel.de>2018-11-26 17:08:27 -0800
commit2bdca80fcc31b44b69628f7ba4b8a3b3ab23f1f1 (patch)
tree73450318402bf1e106e8e903cc33e227dee67603 /src
parent393523c3e7f887bdda7b6c9a629bb5ba585ad3b6 (diff)
downloadpostgresql-2bdca80fcc31b44b69628f7ba4b8a3b3ab23f1f1.tar.gz
postgresql-2bdca80fcc31b44b69628f7ba4b8a3b3ab23f1f1.zip
Update pg_upgrade test for reg* to include regrole and regnamespace.
When the regrole (0c90f6769) and regnamespace (cb9fa802b) types were added in 9.5, pg_upgrade's check for reg* types wasn't updated. While regrole currently is safe, regnamespace is not. It seems unlikely that anybody uses regnamespace inside catalog tables across a pg_upgrade, but the tests should be correct nevertheless. While at it, reorder the types checked in the query to be alphabetical. Otherwise it's annoying to compare existing and tested for types. Author: Andres Freund Discussion: https://postgr.es/m/037e152a-cb25-3bcb-4f35-bdc9988f8204@2ndQuadrant.com Backpatch: 9.5-, as regrole/regnamespace
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_upgrade/check.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index db9ffd2941d..d18137b3a8a 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -895,14 +895,17 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
"WHERE c.oid = a.attrelid AND "
" NOT a.attisdropped AND "
" a.atttypid IN ( "
- " 'pg_catalog.regproc'::pg_catalog.regtype, "
- " 'pg_catalog.regprocedure'::pg_catalog.regtype, "
- " 'pg_catalog.regoper'::pg_catalog.regtype, "
- " 'pg_catalog.regoperator'::pg_catalog.regtype, "
/* regclass.oid is preserved, so 'regclass' is OK */
+ " 'pg_catalog.regconfig'::pg_catalog.regtype, "
+ " 'pg_catalog.regdictionary'::pg_catalog.regtype, "
+ " 'pg_catalog.regnamespace'::pg_catalog.regtype, "
+ " 'pg_catalog.regoper'::pg_catalog.regtype, "
+ " 'pg_catalog.regoperator'::pg_catalog.regtype, "
+ " 'pg_catalog.regproc'::pg_catalog.regtype, "
+ " 'pg_catalog.regprocedure'::pg_catalog.regtype "
+ /* regrole.oid is preserved, so 'regrole' is OK */
/* regtype.oid is preserved, so 'regtype' is OK */
- " 'pg_catalog.regconfig'::pg_catalog.regtype, "
- " 'pg_catalog.regdictionary'::pg_catalog.regtype) AND "
+ " ) AND "
" c.relnamespace = n.oid AND "
" n.nspname NOT IN ('pg_catalog', 'information_schema')");