21#include "catalog/pg_authid_d.h"
35#define PGDUMP_VERSIONSTR "pg_dump (PostgreSQL) " PG_VERSION "\n"
44#define SH_PREFIX rolename
45#define SH_ELEMENT_TYPE RoleNameEntry
46#define SH_KEY_TYPE char *
47#define SH_KEY rolename
48#define SH_HASH_KEY(tb, key) hash_string(key)
49#define SH_EQUAL(tb, a, b) (strcmp(a, b) == 0)
51#define SH_GET_HASH(tb, a) (a)->hashval
52#define SH_SCOPE static inline
53#define SH_RAW_ALLOCATOR pg_malloc0
58static void help(
void);
73 const char *catalog_name,
Oid objectId,
74 const char *objtype,
const char *objname,
119#define PG_AUTHID "pg_authid"
120#define PG_ROLES "pg_roles "
131 static struct option long_options[] = {
200 char *use_role = NULL;
201 const char *dumpencoding = NULL;
203 const char *formatName =
"p";
205 bool data_only =
false;
206 bool globals_only =
false;
207 bool roles_only =
false;
208 bool tablespaces_only =
false;
211 const char *std_strings;
223 if (strcmp(argv[1],
"--help") == 0 || strcmp(argv[1],
"-?") == 0)
228 if (strcmp(argv[1],
"--version") == 0 || strcmp(argv[1],
"-V") == 0)
230 puts(
"pg_dumpall (PostgreSQL) " PG_VERSION);
244 pg_fatal(
"program \"%s\" is needed by %s but was not found in the same directory as \"%s\"",
247 pg_fatal(
"program \"%s\" was found by \"%s\" but was not the same version as %s",
253 while ((
c =
getopt_long(argc, argv,
"acd:E:f:F:gh:l:Op:rsS:tU:vwWx", long_options, &optindex)) != -1)
318 tablespaces_only =
true;
393 pg_log_error(
"too many command-line arguments (first is \"%s\")",
400 (globals_only || roles_only || tablespaces_only))
402 pg_log_error(
"option --exclude-database cannot be used together with -g/--globals-only, -r/--roles-only, or -t/--tablespaces-only");
408 if (globals_only && roles_only)
410 pg_log_error(
"options -g/--globals-only and -r/--roles-only cannot be used together");
415 if (globals_only && tablespaces_only)
417 pg_log_error(
"options -g/--globals-only and -t/--tablespaces-only cannot be used together");
423 pg_fatal(
"option --if-exists requires option -c/--clean");
425 if (roles_only && tablespaces_only)
427 pg_log_error(
"options -r/--roles-only and -t/--tablespaces-only cannot be used together");
442 pg_log_error(
"option -F/--format=d|c|t requires option -f/--file");
524 pg_fatal(
"could not open \"%s\": %m", global_path);
530 pg_fatal(
"could not open output file \"%s\": %m",
544 prompt_password,
false,
548 pg_fatal(
"could not connect to database \"%s\"", pgdb);
553 prompt_password,
false,
557 prompt_password,
true,
562 pg_log_error(
"could not connect to databases \"postgres\" or \"template1\"\n"
563 "Please specify an alternative database.");
581 pg_fatal(
"invalid client encoding \"%s\" specified",
609 fprintf(
OPF,
"--\n-- PostgreSQL database cluster dump\n--\n\n");
621 fprintf(
OPF,
"SET default_transaction_read_only = off;\n\n");
626 fprintf(
OPF,
"SET standard_conforming_strings = %s;\n", std_strings);
627 if (strcmp(std_strings,
"off") == 0)
628 fprintf(
OPF,
"SET escape_string_warning = off;\n");
641 if (!globals_only && !roles_only && !tablespaces_only)
647 if (!tablespaces_only)
655 if (!tablespaces_only)
673 if (!globals_only && !roles_only && !tablespaces_only)
680 fprintf(
OPF,
"--\n-- PostgreSQL database cluster dump complete\n--\n\n");
698 printf(
_(
"%s extracts a PostgreSQL database cluster based on specified dump format.\n\n"),
progname);
702 printf(
_(
"\nGeneral options:\n"));
703 printf(
_(
" -f, --file=FILENAME output file name\n"));
704 printf(
_(
" -F, --format=c|d|t|p output file format (custom, directory, tar,\n"
705 " plain text (default))\n"));
706 printf(
_(
" -v, --verbose verbose mode\n"));
707 printf(
_(
" -V, --version output version information, then exit\n"));
708 printf(
_(
" --lock-wait-timeout=TIMEOUT fail after waiting TIMEOUT for a table lock\n"));
709 printf(
_(
" -?, --help show this help, then exit\n"));
710 printf(
_(
"\nOptions controlling the output content:\n"));
711 printf(
_(
" -a, --data-only dump only the data, not the schema or statistics\n"));
712 printf(
_(
" -c, --clean clean (drop) databases before recreating\n"));
713 printf(
_(
" -E, --encoding=ENCODING dump the data in encoding ENCODING\n"));
714 printf(
_(
" -g, --globals-only dump only global objects, no databases\n"));
715 printf(
_(
" -O, --no-owner skip restoration of object ownership\n"));
716 printf(
_(
" -r, --roles-only dump only roles, no databases or tablespaces\n"));
717 printf(
_(
" -s, --schema-only dump only the schema, no data or statistics\n"));
718 printf(
_(
" -S, --superuser=NAME superuser user name to use in the dump\n"));
719 printf(
_(
" -t, --tablespaces-only dump only tablespaces, no databases or roles\n"));
720 printf(
_(
" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
721 printf(
_(
" --binary-upgrade for use by upgrade utilities only\n"));
722 printf(
_(
" --column-inserts dump data as INSERT commands with column names\n"));
723 printf(
_(
" --disable-dollar-quoting disable dollar quoting, use SQL standard quoting\n"));
724 printf(
_(
" --disable-triggers disable triggers during data-only restore\n"));
725 printf(
_(
" --exclude-database=PATTERN exclude databases whose name matches PATTERN\n"));
726 printf(
_(
" --extra-float-digits=NUM override default setting for extra_float_digits\n"));
727 printf(
_(
" --filter=FILENAME exclude databases based on expressions in FILENAME\n"));
728 printf(
_(
" --if-exists use IF EXISTS when dropping objects\n"));
729 printf(
_(
" --inserts dump data as INSERT commands, rather than COPY\n"));
730 printf(
_(
" --load-via-partition-root load partitions via the root table\n"));
731 printf(
_(
" --no-comments do not dump comment commands\n"));
732 printf(
_(
" --no-data do not dump data\n"));
733 printf(
_(
" --no-policies do not dump row security policies\n"));
734 printf(
_(
" --no-publications do not dump publications\n"));
735 printf(
_(
" --no-role-passwords do not dump passwords for roles\n"));
736 printf(
_(
" --no-schema do not dump schema\n"));
737 printf(
_(
" --no-security-labels do not dump security label assignments\n"));
738 printf(
_(
" --no-statistics do not dump statistics\n"));
739 printf(
_(
" --no-subscriptions do not dump subscriptions\n"));
740 printf(
_(
" --no-sync do not wait for changes to be written safely to disk\n"));
741 printf(
_(
" --no-table-access-method do not dump table access methods\n"));
742 printf(
_(
" --no-tablespaces do not dump tablespace assignments\n"));
743 printf(
_(
" --no-toast-compression do not dump TOAST compression methods\n"));
744 printf(
_(
" --no-unlogged-table-data do not dump unlogged table data\n"));
745 printf(
_(
" --on-conflict-do-nothing add ON CONFLICT DO NOTHING to INSERT commands\n"));
746 printf(
_(
" --quote-all-identifiers quote all identifiers, even if not key words\n"));
747 printf(
_(
" --rows-per-insert=NROWS number of rows per INSERT; implies --inserts\n"));
748 printf(
_(
" --statistics-only dump only the statistics, not schema or data\n"));
749 printf(
_(
" --use-set-session-authorization\n"
750 " use SET SESSION AUTHORIZATION commands instead of\n"
751 " ALTER OWNER commands to set ownership\n"));
752 printf(
_(
" --with-data dump the data\n"));
753 printf(
_(
" --with-schema dump the schema\n"));
754 printf(
_(
" --with-statistics dump the statistics\n"));
756 printf(
_(
"\nConnection options:\n"));
757 printf(
_(
" -d, --dbname=CONNSTR connect using connection string\n"));
758 printf(
_(
" -h, --host=HOSTNAME database server host or socket directory\n"));
759 printf(
_(
" -l, --database=DBNAME alternative default database\n"));
760 printf(
_(
" -p, --port=PORT database server port number\n"));
761 printf(
_(
" -U, --username=NAME connect as specified database user\n"));
762 printf(
_(
" -w, --no-password never prompt for password\n"));
763 printf(
_(
" -W, --password force password prompt (should happen automatically)\n"));
764 printf(
_(
" --role=ROLENAME do SET ROLE before dump\n"));
766 printf(
_(
"\nIf -f/--file is not used, then the SQL script will be written to the standard\n"
768 printf(
_(
"Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
769 printf(
_(
"%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
788 "WHERE rolname !~ '^pg_' "
805 const char *rolename;
850 "SELECT oid, rolname, rolsuper, rolinherit, "
851 "rolcreaterole, rolcreatedb, "
852 "rolcanlogin, rolconnlimit, rolpassword, "
853 "rolvaliduntil, rolreplication, rolbypassrls, "
854 "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
855 "rolname = current_user AS is_current_user "
857 "WHERE rolname !~ '^pg_' "
861 "SELECT oid, rolname, rolsuper, rolinherit, "
862 "rolcreaterole, rolcreatedb, "
863 "rolcanlogin, rolconnlimit, rolpassword, "
864 "rolvaliduntil, rolreplication, rolbypassrls, "
865 "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
866 "rolname = current_user AS is_current_user "
871 "SELECT oid, rolname, rolsuper, rolinherit, "
872 "rolcreaterole, rolcreatedb, "
873 "rolcanlogin, rolconnlimit, rolpassword, "
874 "rolvaliduntil, rolreplication, "
875 "false as rolbypassrls, "
876 "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
877 "rolname = current_user AS is_current_user "
886 i_rolinherit =
PQfnumber(res,
"rolinherit");
887 i_rolcreaterole =
PQfnumber(res,
"rolcreaterole");
888 i_rolcreatedb =
PQfnumber(res,
"rolcreatedb");
889 i_rolcanlogin =
PQfnumber(res,
"rolcanlogin");
890 i_rolconnlimit =
PQfnumber(res,
"rolconnlimit");
891 i_rolpassword =
PQfnumber(res,
"rolpassword");
892 i_rolvaliduntil =
PQfnumber(res,
"rolvaliduntil");
893 i_rolreplication =
PQfnumber(res,
"rolreplication");
894 i_rolbypassrls =
PQfnumber(res,
"rolbypassrls");
895 i_rolcomment =
PQfnumber(res,
"rolcomment");
896 i_is_current_user =
PQfnumber(res,
"is_current_user");
903 const char *rolename;
909 if (strncmp(rolename,
"pg_", 3) == 0)
922 "SELECT pg_catalog.binary_upgrade_set_next_pg_authid_oid('%u'::pg_catalog.oid);\n\n",
935 strcmp(
PQgetvalue(res,
i, i_is_current_user),
"f") == 0)
939 if (strcmp(
PQgetvalue(res,
i, i_rolsuper),
"t") == 0)
944 if (strcmp(
PQgetvalue(res,
i, i_rolinherit),
"t") == 0)
949 if (strcmp(
PQgetvalue(res,
i, i_rolcreaterole),
"t") == 0)
954 if (strcmp(
PQgetvalue(res,
i, i_rolcreatedb),
"t") == 0)
959 if (strcmp(
PQgetvalue(res,
i, i_rolcanlogin),
"t") == 0)
964 if (strcmp(
PQgetvalue(res,
i, i_rolreplication),
"t") == 0)
969 if (strcmp(
PQgetvalue(res,
i, i_rolbypassrls),
"t") == 0)
974 if (strcmp(
PQgetvalue(res,
i, i_rolconnlimit),
"-1") != 0)
1038 bool dump_grant_options;
1046 int i_inherit_option;
1069 "um.rolname AS member, "
1070 "ug.rolname AS grantor, "
1071 "a.roleid AS roleid, "
1072 "a.member AS memberid, "
1073 "a.grantor AS grantorid, "
1075 if (dump_grant_options)
1078 "LEFT JOIN %s ur on ur.oid = a.roleid "
1079 "LEFT JOIN %s um on um.oid = a.member "
1080 "LEFT JOIN %s ug on ug.oid = a.grantor "
1081 "WHERE NOT (ur.rolname ~ '^pg_' AND um.rolname ~ '^pg_')"
1088 i_memberid =
PQfnumber(res,
"memberid");
1089 i_grantorid =
PQfnumber(res,
"grantorid");
1090 i_admin_option =
PQfnumber(res,
"admin_option");
1091 i_inherit_option =
PQfnumber(res,
"inherit_option");
1092 i_set_option =
PQfnumber(res,
"set_option");
1095 fprintf(
OPF,
"--\n-- Role memberships\n--\n\n");
1112 while (
start < total)
1118 int prev_remaining = 0;
1125 pg_log_warning(
"found orphaned pg_auth_members entry for role %s",
1131 for (end =
start; end < total; ++end)
1136 if (strcmp(role, otherrole) != 0)
1158 pg_log_error(
"could not find a legal dump ordering for memberships in role \"%s\"",
1183 pg_log_warning(
"found orphaned pg_auth_members entry for role %s",
1192 pg_log_warning(
"found orphaned pg_auth_members entry for role %s",
1203 if (dump_grant_options)
1212 if (dump_grantors &&
1213 atooid(grantorid) != BOOTSTRAP_SUPERUSERID &&
1214 rolename_lookup(ht, grantor) == NULL)
1226 rolename_insert(ht, member, &found);
1234 if (dump_grant_options)
1238 if (optbuf->
data[0] !=
'\0')
1247 if (optbuf->
data[0] !=
'\0')
1251 if (optbuf->
data[0] !=
'\0')
1259 rolename_destroy(ht);
1288 "pg_catalog.pg_get_userbyid(" CppAsString2(BOOTSTRAP_SUPERUSERID)
") AS parowner, "
1290 "pg_catalog.acldefault('p', " CppAsString2(BOOTSTRAP_SUPERUSERID)
") AS acldefault "
1291 "FROM pg_catalog.pg_parameter_acl "
1295 fprintf(
OPF,
"--\n-- Role privileges on configuration parameters\n--\n\n");
1313 pg_log_error(
"could not parse ACL list (%s) for parameter \"%s\"",
1344 "FROM pg_catalog.pg_tablespace "
1345 "WHERE spcname !~ '^pg_' "
1349 fprintf(
OPF,
"--\n-- Drop tablespaces\n--\n\n");
1379 "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
1380 "pg_catalog.pg_tablespace_location(oid), "
1381 "spcacl, acldefault('t', spcowner) AS acldefault, "
1382 "array_to_string(spcoptions, ', '),"
1383 "pg_catalog.shobj_description(oid, 'pg_tablespace') "
1384 "FROM pg_catalog.pg_tablespace "
1385 "WHERE spcname !~ '^pg_' "
1410 appendPQExpBuffer(
buf,
"SELECT pg_catalog.binary_upgrade_set_next_pg_tablespace_oid('%u'::pg_catalog.oid);\n", spcoid);
1429 if (spcoptions && spcoptions[0] !=
'\0')
1431 fspcname, spcoptions);
1440 pg_log_error(
"could not parse ACL list (%s) for tablespace \"%s\"",
1446 if (!
no_comments && spccomment && spccomment[0] !=
'\0')
1455 "TABLESPACE", spcname,
1484 "FROM pg_database d "
1485 "WHERE datallowconn AND datconnlimit != -2 "
1486 "ORDER BY datname");
1489 fprintf(
OPF,
"--\n-- Drop databases (except postgres and template1)\n--\n\n");
1500 if (strcmp(
dbname,
"template1") != 0 &&
1501 strcmp(
dbname,
"template0") != 0 &&
1502 strcmp(
dbname,
"postgres") != 0)
1524 static bool header_done =
false;
1527 "WHERE setdatabase = 0 AND setrole = "
1528 "(SELECT oid FROM %s WHERE rolname = ",
1538 fprintf(
OPF,
"\n--\n-- User Configurations\n--\n");
1570 if (patterns->
head == NULL)
1586 "SELECT datname FROM pg_catalog.pg_database n\n");
1588 false, NULL,
"datname", NULL, NULL, NULL,
1593 pg_log_error(
"improper qualified name (too many dotted names): %s",
1622 FILE *map_file = NULL;
1636 "SELECT datname, oid "
1637 "FROM pg_database d "
1638 "WHERE datallowconn AND datconnlimit != -2 "
1639 "ORDER BY (datname <> 'template1'), datname");
1657 pg_fatal(
"could not create subdirectory \"%s\": %m", db_subdir);
1671 const char *create_opts =
"";
1675 if (strcmp(
dbname,
"template0") == 0)
1693 else if (archDumpFormat ==
archTar)
1715 if (strcmp(
dbname,
"template1") == 0 || strcmp(
dbname,
"postgres") == 0)
1718 create_opts =
"--clean --create";
1720 else if (archDumpFormat ==
archNull)
1724 create_opts =
"--create";
1744 pg_fatal(
"could not re-open the output file \"%s\": %m",
1779 dbfile, create_opts);
1785 else if (archDumpFormat ==
archTar)
1816 ret = system(cmd.
data);
1837 const char *objtype,
const char *objname,
1882 time_t
now = time(NULL);
1974 pg_fatal(
"unrecognized archive format \"%s\"; please specify \"c\", \"d\", \"p\", or \"t\"",
1977 return archDumpFormat;
Acl * acldefault(ObjectType objtype, Oid ownerId)
Datum now(PG_FUNCTION_ARGS)
#define PG_TEXTDOMAIN(domain)
int find_my_exec(const char *argv0, char *retpath)
void set_pglocale_pgservice(const char *argv0, const char *app)
int find_other_exec(const char *argv0, const char *target, const char *versionstr, char *retpath)
PGresult * executeQuery(PGconn *conn, const char *query)
PGconn * ConnectDatabase(const char *dbname, const char *connection_string, const char *pghost, const char *pgport, const char *pguser, trivalue prompt_password, bool fail_on_error, const char *progname, const char **connstr, int *server_version, char *password, char *override_dbname)
#define fprintf(file, fmt, msg)
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)
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)
void create_or_open_dir(const char *dirname)
void emitShSecLabels(PGconn *conn, PGresult *res, PQExpBuffer buffer, const char *objtype, const char *objname)
#define PGDUMP_STRFTIME_FMT
void fsync_fname(const char *fname, bool isdir)
int PQserverVersion(const PGconn *conn)
const char * PQparameterStatus(const PGconn *conn, const char *paramName)
int PQclientEncoding(const PGconn *conn)
void PQfinish(PGconn *conn)
char * PQerrorMessage(const PGconn *conn)
int PQsetClientEncoding(PGconn *conn, const char *encoding)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
ExecStatusType PQresultStatus(const PGresult *res)
void PQclear(PGresult *res)
int PQntuples(const PGresult *res)
int PQfnumber(const PGresult *res, const char *field_name)
int PQgetisnull(const PGresult *res, int tup_num, int field_num)
PGresult * PQexec(PGconn *conn, const char *query)
char * pg_strdup(const char *in)
void * pg_malloc0(size_t size)
void filter_init(FilterStateData *fstate, const char *filename, exit_function f_exit)
void filter_free(FilterStateData *fstate)
const char * filter_object_type_name(FilterObjectType fot)
bool filter_read_item(FilterStateData *fstate, char **objname, FilterCommandType *comtype, FilterObjectType *objtype)
void pg_log_filter_error(FilterStateData *fstate, const char *fmt,...)
@ FILTER_OBJECT_TYPE_TABLE_DATA_AND_CHILDREN
@ FILTER_OBJECT_TYPE_SCHEMA
@ FILTER_OBJECT_TYPE_INDEX
@ FILTER_OBJECT_TYPE_TRIGGER
@ FILTER_OBJECT_TYPE_FOREIGN_DATA
@ FILTER_OBJECT_TYPE_DATABASE
@ FILTER_OBJECT_TYPE_FUNCTION
@ FILTER_OBJECT_TYPE_TABLE_DATA
@ FILTER_OBJECT_TYPE_NONE
@ FILTER_OBJECT_TYPE_TABLE_AND_CHILDREN
@ FILTER_OBJECT_TYPE_EXTENSION
@ FILTER_OBJECT_TYPE_TABLE
@ FILTER_COMMAND_TYPE_INCLUDE
int getopt_long(int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex)
#define required_argument
void pg_logging_increase_verbosity(void)
void pg_logging_init(const char *argv0)
void pg_logging_set_level(enum pg_log_level new_level)
#define pg_log_error(...)
#define pg_log_error_hint(...)
#define pg_log_error_detail(...)
enum _archiveFormat ArchiveFormat
void exit_nicely(int code)
static void dumpTimestamp(const char *msg)
static int on_conflict_do_nothing
int main(int argc, char *argv[])
static void dropTablespaces(PGconn *conn)
static void expand_dbname_patterns(PGconn *conn, SimpleStringList *patterns, SimpleStringList *names)
static int no_role_passwords
static PQExpBuffer pgdumpopts
static int statistics_only
static int no_table_access_method
static int no_unlogged_table_data
static int binary_upgrade
static int disable_triggers
static void dumpUserConfig(PGconn *conn, const char *username)
static const char * connstr
static SimpleStringList database_exclude_patterns
static void dumpTablespaces(PGconn *conn)
static void dumpRoleMembership(PGconn *conn)
static char pg_dump_bin[MAXPGPATH]
static SimpleStringList database_exclude_names
static int no_publications
static int no_security_labels
static ArchiveFormat parseDumpFormat(const char *format)
static void dumpDatabases(PGconn *conn, ArchiveFormat archDumpFormat)
static int disable_dollar_quoting
static void buildShSecLabels(PGconn *conn, const char *catalog_name, Oid objectId, const char *objtype, const char *objname, PQExpBuffer buffer)
static int no_tablespaces
static int no_toast_compression
static void executeCommand(PGconn *conn, const char *query)
static void dumpRoleGUCPrivs(PGconn *conn)
static void dumpRoles(PGconn *conn)
static int use_setsessauth
static int load_via_partition_root
static int column_inserts
static void read_dumpall_filters(const char *filename, SimpleStringList *pattern)
static void dropRoles(PGconn *conn)
static void dropDBs(PGconn *conn)
static int server_version
static char role_catalog[10]
static int no_subscriptions
static int with_statistics
static int runPgDump(const char *dbname, const char *create_opts, char *dbfile, ArchiveFormat archDumpFormat)
#define PGDUMP_VERSIONSTR
PGDLLIMPORT char * optarg
#define pg_encoding_to_char
static const char * pghost
static const char * pgport
#define pg_log_warning(...)
#define is_absolute_path(filename)
int pg_strcasecmp(const char *s1, const char *s2)
const char * get_progname(const char *argv0)
size_t strlcpy(char *dst, const char *src, size_t siz)
void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...)
PQExpBuffer createPQExpBuffer(void)
void initPQExpBuffer(PQExpBuffer str)
void resetPQExpBuffer(PQExpBuffer str)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void destroyPQExpBuffer(PQExpBuffer str)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
void termPQExpBuffer(PQExpBuffer str)
bool quote_all_identifiers
bool simple_string_list_member(SimpleStringList *list, const char *val)
void simple_string_list_append(SimpleStringList *list, const char *val)
const char * fmtId(const char *rawid)
void setFmtEncoding(int encoding)
void appendShellString(PQExpBuffer buf, const char *str)
void appendStringLiteralConn(PQExpBuffer buf, const char *str, PGconn *conn)
bool processSQLNamePattern(PGconn *conn, PQExpBuffer buf, const char *pattern, bool have_where, bool force_escape, const char *schemavar, const char *namevar, const char *altnamevar, const char *visibilityrule, PQExpBuffer dbnamebuf, int *dotcnt)
void appendConnStrVal(PQExpBuffer buf, const char *str)
struct SimpleStringListCell * next
SimpleStringListCell * head