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

Commit ac218aa

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 7a9d677 commit ac218aa

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/bin/pg_upgrade/check.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -1015,14 +1015,17 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
10151015
"WHERE c.oid = a.attrelid AND "
10161016
" NOT a.attisdropped AND "
10171017
" a.atttypid IN ( "
1018-
" 'pg_catalog.regproc'::pg_catalog.regtype, "
1019-
" 'pg_catalog.regprocedure'::pg_catalog.regtype, "
1018+
/* regclass.oid is preserved, so 'regclass' is OK */
1019+
" 'pg_catalog.regconfig'::pg_catalog.regtype, "
1020+
" 'pg_catalog.regdictionary'::pg_catalog.regtype, "
1021+
" 'pg_catalog.regnamespace'::pg_catalog.regtype, "
10201022
" 'pg_catalog.regoper'::pg_catalog.regtype, "
10211023
" 'pg_catalog.regoperator'::pg_catalog.regtype, "
1022-
/* regclass.oid is preserved, so 'regclass' is OK */
1024+
" 'pg_catalog.regproc'::pg_catalog.regtype, "
1025+
" 'pg_catalog.regprocedure'::pg_catalog.regtype "
1026+
/* regrole.oid is preserved, so 'regrole' is OK */
10231027
/* regtype.oid is preserved, so 'regtype' is OK */
1024-
" 'pg_catalog.regconfig'::pg_catalog.regtype, "
1025-
" 'pg_catalog.regdictionary'::pg_catalog.regtype) AND "
1028+
" ) AND "
10261029
" c.relnamespace = n.oid AND "
10271030
" n.nspname NOT IN ('pg_catalog', 'information_schema')");
10281031

0 commit comments

Comments
 (0)