Skip to content

Commit 64d60c8

Browse files
committed
Correct pg_dump WHERE clause for functions/aggregates
The query to grab the function/aggregate information is now joining to pg_init_privs, so we can simplify (and correct) the WHERE clause used to determine if a given function's ACL has changed from the initial ACL on the function. Bug found by Noah, patch by me.
1 parent e324f8a commit 64d60c8

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4673,11 +4673,7 @@ getAggregates(Archive *fout, int *numAggs)
46734673
"p.pronamespace != "
46744674
"(SELECT oid FROM pg_namespace "
46754675
"WHERE nspname = 'pg_catalog') OR "
4676-
"EXISTS (SELECT * FROM pg_init_privs pip "
4677-
"WHERE p.oid = pip.objoid AND pip.classoid = "
4678-
"(SELECT oid FROM pg_class "
4679-
"WHERE relname = 'pg_proc') "
4680-
"AND p.proacl IS DISTINCT FROM pip.initprivs)",
4676+
"p.proacl IS DISTINCT FROM pip.initprivs",
46814677
username_subquery,
46824678
acl_subquery->data,
46834679
racl_subquery->data,
@@ -4923,11 +4919,7 @@ getFuncs(Archive *fout, int *numFuncs)
49234919
"pronamespace != "
49244920
"(SELECT oid FROM pg_namespace "
49254921
"WHERE nspname = 'pg_catalog') OR "
4926-
"EXISTS (SELECT * FROM pg_init_privs pip "
4927-
"WHERE p.oid = pip.objoid AND pip.classoid = "
4928-
"(SELECT oid FROM pg_class "
4929-
"WHERE relname = 'pg_proc') "
4930-
"AND p.proacl IS DISTINCT FROM pip.initprivs)",
4922+
"p.proacl IS DISTINCT FROM pip.initprivs",
49314923
acl_subquery->data,
49324924
racl_subquery->data,
49334925
initacl_subquery->data,

0 commit comments

Comments
 (0)