Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 203a909

Browse files
committed
Update pg_upgrade test for reg* to include regrole and regnamespace.
When the regrole (0c90f67) and regnamespace (cb9fa80) 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
1 parent ad6dfc6 commit 203a909

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/bin/pg_upgrade/check.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -919,14 +919,17 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
919919
"WHERE c.oid = a.attrelid AND "
920920
" NOT a.attisdropped AND "
921921
" a.atttypid IN ( "
922-
" 'pg_catalog.regproc'::pg_catalog.regtype, "
923-
" 'pg_catalog.regprocedure'::pg_catalog.regtype, "
922+
/* regclass.oid is preserved, so 'regclass' is OK */
923+
" 'pg_catalog.regconfig'::pg_catalog.regtype, "
924+
" 'pg_catalog.regdictionary'::pg_catalog.regtype, "
925+
" 'pg_catalog.regnamespace'::pg_catalog.regtype, "
924926
" 'pg_catalog.regoper'::pg_catalog.regtype, "
925927
" 'pg_catalog.regoperator'::pg_catalog.regtype, "
926-
/* regclass.oid is preserved, so 'regclass' is OK */
928+
" 'pg_catalog.regproc'::pg_catalog.regtype, "
929+
" 'pg_catalog.regprocedure'::pg_catalog.regtype "
930+
/* regrole.oid is preserved, so 'regrole' is OK */
927931
/* regtype.oid is preserved, so 'regtype' is OK */
928-
" 'pg_catalog.regconfig'::pg_catalog.regtype, "
929-
" 'pg_catalog.regdictionary'::pg_catalog.regtype) AND "
932+
" ) AND "
930933
" c.relnamespace = n.oid AND "
931934
" n.nspname NOT IN ('pg_catalog', 'information_schema')");
932935

0 commit comments

Comments
 (0)