summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-12-06 12:39:45 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-12-06 12:39:45 -0500
commit0c9d84427f441602425b0e18be5cfe751d1d8ebe (patch)
tree0413d147aa918d556f081a4720258d8cf0dba6d7 /src/bin/pg_dump/dumputils.h
parent5209c0ba0bfd16f23e38f707e487c0626e70564c (diff)
Rethink pg_dump's handling of object ACLs.
Throw away most of the existing logic for this, as it was very inefficient thanks to expensive sub-selects executed to collect ACL data that we very possibly would have no interest in dumping. Reduce the ACL handling in the initial per-object-type queries to be just collection of the catalog ACL fields, as it was originally. Fetch pg_init_privs data separately in a single scan of that catalog, and do the merging calculations on the client side. Remove the separate code path used for pre-9.6 source servers; there is no good reason to treat them differently from newer servers that happen to have empty pg_init_privs. Discussion: https://postgr.es/m/2273648.1634764485@sss.pgh.pa.us Discussion: https://postgr.es/m/7d7eb6128f40401d81b3b7a898b6b4de@W2012-02.nidsa.loc
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r--src/bin/pg_dump/dumputils.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h
index f5465f19aee..fac7a05c913 100644
--- a/src/bin/pg_dump/dumputils.h
+++ b/src/bin/pg_dump/dumputils.h
@@ -37,26 +37,22 @@
extern bool buildACLCommands(const char *name, const char *subname, const char *nspname,
- const char *type, const char *acls, const char *racls,
+ const char *type, const char *acls, const char *baseacls,
const char *owner, const char *prefix, int remoteVersion,
PQExpBuffer sql);
extern bool buildDefaultACLCommands(const char *type, const char *nspname,
- const char *acls, const char *racls,
- const char *initacls, const char *initracls,
+ const char *acls, const char *acldefault,
const char *owner,
int remoteVersion,
PQExpBuffer sql);
+
+extern void quoteAclUserName(PQExpBuffer output, const char *input);
+
extern void buildShSecLabelQuery(const char *catalog_name,
Oid objectId, PQExpBuffer sql);
extern void emitShSecLabels(PGconn *conn, PGresult *res,
PQExpBuffer buffer, const char *objtype, const char *objname);
-extern void buildACLQueries(PQExpBuffer acl_subquery, PQExpBuffer racl_subquery,
- PQExpBuffer init_acl_subquery, PQExpBuffer init_racl_subquery,
- const char *acl_column, const char *acl_owner,
- const char *initprivs_expr,
- const char *obj_kind, bool binary_upgrade);
-
extern bool variable_is_guc_list_quote(const char *name);
extern bool SplitGUCList(char *rawstring, char separator,