1/*-------------------------------------------------------------------------
3 * Utility routines for SQL dumping
5 * Basically this is stuff that is useful in both pg_dump and pg_dumpall.
8 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/bin/pg_dump/dumputils.h
13 *-------------------------------------------------------------------------
22 * Preferred strftime(3) format specifier for printing timestamps in pg_dump
25 * We don't print the timezone on Windows, because the names are long and
26 * localized, which means they may contain characters in various random
27 * encodings; this has been seen to cause encoding errors when reading the
28 * dump script. Think not to get around that by using %z, because
29 * (1) %z is not portable to pre-C99 systems, and
30 * (2) %z doesn't actually act differently from %Z on Windows anyway.
33 #define PGDUMP_STRFTIME_FMT "%Y-%m-%d %H:%M:%S %Z"
35#define PGDUMP_STRFTIME_FMT "%Y-%m-%d %H:%M:%S"
41 const char *
type,
const char *acls,
const char *baseacls,
42 const char *owner,
const char *prefix,
int remoteVersion,
55 PQExpBuffer buffer,
const char *objtype,
const char *objname);
64 const char *type2,
const char *name2,
71#endif /* DUMPUTILS_H */
Acl * acldefault(ObjectType objtype, Oid ownerId)
char * generate_restrict_key(void)
bool buildACLCommands(const char *name, const char *subname, const char *nspname, const char *type, const char *acls, const char *baseacls, const char *owner, const char *prefix, int remoteVersion, PQExpBuffer sql)
bool valid_restrict_key(const char *restrict_key)
void buildShSecLabelQuery(const char *catalog_name, Oid objectId, PQExpBuffer sql)
void makeAlterConfigCommand(PGconn *conn, const char *configitem, const char *type, const char *name, const char *type2, const char *name2, PQExpBuffer buf)
bool buildDefaultACLCommands(const char *type, const char *nspname, const char *acls, const char *acldefault, const char *owner, int remoteVersion, PQExpBuffer sql)
char * sanitize_line(const char *str, bool want_hyphen)
void create_or_open_dir(const char *dirname)
bool variable_is_guc_list_quote(const char *name)
void quoteAclUserName(PQExpBuffer output, const char *input)
void emitShSecLabels(PGconn *conn, PGresult *res, PQExpBuffer buffer, const char *objtype, const char *objname)
bool SplitGUCList(char *rawstring, char separator, char ***namelist)
static char * restrict_key