Commit 64d60c8b authored by Stephen Frost's avatar Stephen Frost

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.
parent e324f8ad
......@@ -4673,11 +4673,7 @@ getAggregates(Archive *fout, int *numAggs)
"p.pronamespace != "
"(SELECT oid FROM pg_namespace "
"WHERE nspname = 'pg_catalog') OR "
"EXISTS (SELECT * FROM pg_init_privs pip "
"WHERE p.oid = pip.objoid AND pip.classoid = "
"(SELECT oid FROM pg_class "
"WHERE relname = 'pg_proc') "
"AND p.proacl IS DISTINCT FROM pip.initprivs)",
"p.proacl IS DISTINCT FROM pip.initprivs",
username_subquery,
acl_subquery->data,
racl_subquery->data,
......@@ -4923,11 +4919,7 @@ getFuncs(Archive *fout, int *numFuncs)
"pronamespace != "
"(SELECT oid FROM pg_namespace "
"WHERE nspname = 'pg_catalog') OR "
"EXISTS (SELECT * FROM pg_init_privs pip "
"WHERE p.oid = pip.objoid AND pip.classoid = "
"(SELECT oid FROM pg_class "
"WHERE relname = 'pg_proc') "
"AND p.proacl IS DISTINCT FROM pip.initprivs)",
"p.proacl IS DISTINCT FROM pip.initprivs",
acl_subquery->data,
racl_subquery->data,
initacl_subquery->data,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment