mirror of https://github.com/postgres/postgres
Make pg_dumpall's database ACL query independent of hash table order.
Previously GRANT order on databases was not well defined, due to the use of EXCEPT without an ORDER BY. Add an ORDER BY, adapt test output. I don't, at the moment, see reason to backpatch this.
This commit is contained in:
parent
248776ea06
commit
b4fc645787
|
@ -1307,11 +1307,13 @@ dumpCreateDB(PGconn *conn)
|
|||
"pg_encoding_to_char(d.encoding), "
|
||||
"datcollate, datctype, datfrozenxid, datminmxid, "
|
||||
"datistemplate, "
|
||||
"(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(coalesce(datacl,pg_catalog.acldefault('d',datdba))) AS acl "
|
||||
"EXCEPT SELECT pg_catalog.unnest(pg_catalog.acldefault('d',datdba))) as foo)"
|
||||
"(SELECT pg_catalog.array_agg(acl ORDER BY acl::text) FROM ( "
|
||||
" SELECT pg_catalog.unnest(coalesce(datacl,pg_catalog.acldefault('d',datdba))) AS acl "
|
||||
" EXCEPT SELECT pg_catalog.unnest(pg_catalog.acldefault('d',datdba))) as datacls)"
|
||||
"AS datacl, "
|
||||
"(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(pg_catalog.acldefault('d',datdba)) AS acl "
|
||||
"EXCEPT SELECT pg_catalog.unnest(coalesce(datacl,pg_catalog.acldefault('d',datdba)))) as foo)"
|
||||
"(SELECT pg_catalog.array_agg(acl ORDER BY acl::text) FROM ( "
|
||||
" SELECT pg_catalog.unnest(pg_catalog.acldefault('d',datdba)) AS acl "
|
||||
" EXCEPT SELECT pg_catalog.unnest(coalesce(datacl,pg_catalog.acldefault('d',datdba)))) as rdatacls)"
|
||||
"AS rdatacl, "
|
||||
"datconnlimit, "
|
||||
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
|
||||
|
|
|
@ -2484,6 +2484,7 @@ qr/^GRANT SELECT ON TABLE test_third_table TO regress_dump_test_role;/m,
|
|||
create_sql => 'REVOKE CONNECT ON DATABASE dump_test FROM public;',
|
||||
regexp => qr/^
|
||||
\QREVOKE CONNECT,TEMPORARY ON DATABASE dump_test FROM PUBLIC;\E\n
|
||||
\QGRANT CREATE ON DATABASE dump_test TO regress_dump_test_role;\E\n
|
||||
\QGRANT TEMPORARY ON DATABASE dump_test TO PUBLIC;\E
|
||||
/xm,
|
||||
like => { pg_dumpall_dbprivs => 1, },
|
||||
|
|
Loading…
Reference in New Issue