|
bool | describeAggregates (const char *pattern, bool verbose, bool showSystem) |
|
bool | describeAccessMethods (const char *pattern, bool verbose) |
|
bool | describeTablespaces (const char *pattern, bool verbose) |
|
bool | describeFunctions (const char *functypes, const char *func_pattern, char **arg_patterns, int num_arg_patterns, bool verbose, bool showSystem) |
|
bool | describeTypes (const char *pattern, bool verbose, bool showSystem) |
|
bool | describeOperators (const char *oper_pattern, char **arg_patterns, int num_arg_patterns, bool verbose, bool showSystem) |
|
bool | describeRoles (const char *pattern, bool verbose, bool showSystem) |
|
bool | listDbRoleSettings (const char *pattern, const char *pattern2) |
|
bool | describeRoleGrants (const char *pattern, bool showSystem) |
|
bool | permissionsList (const char *pattern, bool showSystem) |
|
bool | listDefaultACLs (const char *pattern) |
|
bool | objectDescription (const char *pattern, bool showSystem) |
|
bool | describeTableDetails (const char *pattern, bool verbose, bool showSystem) |
|
bool | listTSConfigs (const char *pattern, bool verbose) |
|
bool | listTSParsers (const char *pattern, bool verbose) |
|
bool | listTSDictionaries (const char *pattern, bool verbose) |
|
bool | listTSTemplates (const char *pattern, bool verbose) |
|
bool | listAllDbs (const char *pattern, bool verbose) |
|
bool | listTables (const char *tabtypes, const char *pattern, bool verbose, bool showSystem) |
|
bool | listPartitionedTables (const char *reltypes, const char *pattern, bool verbose) |
|
bool | listDomains (const char *pattern, bool verbose, bool showSystem) |
|
bool | listConversions (const char *pattern, bool verbose, bool showSystem) |
|
bool | describeConfigurationParameters (const char *pattern, bool verbose, bool showSystem) |
|
bool | listCasts (const char *pattern, bool verbose) |
|
bool | listCollations (const char *pattern, bool verbose, bool showSystem) |
|
bool | listSchemas (const char *pattern, bool verbose, bool showSystem) |
|
bool | listForeignDataWrappers (const char *pattern, bool verbose) |
|
bool | listForeignServers (const char *pattern, bool verbose) |
|
bool | listUserMappings (const char *pattern, bool verbose) |
|
bool | listForeignTables (const char *pattern, bool verbose) |
|
bool | listLanguages (const char *pattern, bool verbose, bool showSystem) |
|
bool | listExtensions (const char *pattern) |
|
bool | listExtensionContents (const char *pattern) |
|
bool | listExtendedStats (const char *pattern) |
|
bool | listEventTriggers (const char *pattern, bool verbose) |
|
bool | listPublications (const char *pattern) |
|
bool | describePublications (const char *pattern) |
|
bool | describeSubscriptions (const char *pattern, bool verbose) |
|
bool | listOperatorClasses (const char *access_method_pattern, const char *type_pattern, bool verbose) |
|
bool | listOperatorFamilies (const char *access_method_pattern, const char *type_pattern, bool verbose) |
|
bool | listOpFamilyOperators (const char *access_method_pattern, const char *family_pattern, bool verbose) |
|
bool | listOpFamilyFunctions (const char *access_method_pattern, const char *family_pattern, bool verbose) |
|
bool | listLargeObjects (bool verbose) |
|
bool describeAccessMethods |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 141 of file describe.c.
146 static const bool translate_columns[] = {
false,
true,
false,
false};
152 pg_log_error(
"The server (version %s) does not support access methods.",
154 sverbuf,
sizeof(sverbuf)));
161 "SELECT amname AS \"%s\",\n"
163 " WHEN 'i' THEN '%s'"
164 " WHEN 't' THEN '%s'"
174 ",\n amhandler AS \"%s\",\n"
175 " pg_catalog.obj_description(oid, 'pg_am') AS \"%s\"",
181 "\nFROM pg_catalog.pg_am\n");
184 NULL,
"amname", NULL,
199 myopt.
title =
_(
"List of access methods");
PGresult * PSQLexec(const char *query)
static void PGresult * res
static bool validateSQLNamePattern(PQExpBuffer buf, const char *pattern, bool have_where, bool force_escape, const char *schemavar, const char *namevar, const char *altnamevar, const char *visibilityrule, bool *added_clause, int maxparts)
void printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout, bool is_pager, FILE *flog)
#define pg_log_error(...)
void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void initPQExpBuffer(PQExpBuffer str)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
void termPQExpBuffer(PQExpBuffer str)
char * formatPGVersionNumber(int version_number, bool include_minor, char *buf, size_t buflen)
const bool * translate_columns
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, formatPGVersionNumber(), gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool describeAggregates |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 71 of file describe.c.
80 "SELECT n.nspname as \"%s\",\n"
81 " p.proname AS \"%s\",\n"
82 " pg_catalog.format_type(p.prorettype, NULL) AS \"%s\",\n"
83 " CASE WHEN p.pronargs = 0\n"
84 " THEN CAST('*' AS pg_catalog.text)\n"
85 " ELSE pg_catalog.pg_get_function_arguments(p.oid)\n"
94 " pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n"
95 "FROM pg_catalog.pg_proc p\n"
96 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
97 "WHERE p.prokind = 'a'\n",
101 " pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n"
102 "FROM pg_catalog.pg_proc p\n"
103 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
104 "WHERE p.proisagg\n",
107 if (!showSystem && !pattern)
109 " AND n.nspname <> 'information_schema'\n");
112 "n.nspname",
"p.proname", NULL,
113 "pg_catalog.pg_function_is_visible(p.oid)",
127 myopt.
title =
_(
"List of aggregate functions");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool describeConfigurationParameters |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 4598 of file describe.c.
4607 "SELECT s.name AS \"%s\", "
4608 "pg_catalog.current_setting(s.name) AS \"%s\"",
4615 ", s.vartype AS \"%s\", s.context AS \"%s\", ",
4629 " LEFT JOIN pg_catalog.pg_parameter_acl p\n"
4630 " ON pg_catalog.lower(s.name) = p.parname\n");
4635 NULL,
"pg_catalog.lower(s.name)", NULL,
4639 " s.setting IS DISTINCT FROM s.boot_val\n");
4649 myopt.
title =
_(
"List of configuration parameters");
4651 myopt.
title =
_(
"List of non-default configuration parameters");
static void printACLColumn(PQExpBuffer buf, const char *colname)
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)
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, _psqlSettings::db, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), processSQLNamePattern(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and verbose.
Referenced by exec_command_d().
bool describeFunctions |
( |
const char * |
functypes, |
|
|
const char * |
func_pattern, |
|
|
char ** |
arg_patterns, |
|
|
int |
num_arg_patterns, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 288 of file describe.c.
292 bool showAggregate = strchr(functypes,
'a') != NULL;
293 bool showNormal = strchr(functypes,
'n') != NULL;
294 bool showProcedure = strchr(functypes,
'p') != NULL;
295 bool showTrigger = strchr(functypes,
't') != NULL;
296 bool showWindow = strchr(functypes,
'w') != NULL;
301 static const bool translate_columns[] = {
false,
false,
false,
false,
true,
true,
true,
false,
true,
false,
false,
false,
false};
304 static const bool translate_columns_pre_96[] = {
false,
false,
false,
false,
true,
true,
false,
true,
false,
false,
false,
false};
306 if (strlen(functypes) != strspn(functypes,
"anptwS+"))
316 pg_log_error(
"\\df does not take a \"%c\" option with server version %s",
319 sverbuf,
sizeof(sverbuf)));
323 if (!showAggregate && !showNormal && !showProcedure && !showTrigger && !showWindow)
325 showAggregate = showNormal = showTrigger = showWindow =
true;
327 showProcedure =
true;
333 "SELECT n.nspname as \"%s\",\n"
334 " p.proname as \"%s\",\n",
340 " pg_catalog.pg_get_function_result(p.oid) as \"%s\",\n"
341 " pg_catalog.pg_get_function_arguments(p.oid) as \"%s\",\n"
343 " WHEN 'a' THEN '%s'\n"
344 " WHEN 'w' THEN '%s'\n"
345 " WHEN 'p' THEN '%s'\n"
358 " pg_catalog.pg_get_function_result(p.oid) as \"%s\",\n"
359 " pg_catalog.pg_get_function_arguments(p.oid) as \"%s\",\n"
361 " WHEN p.proisagg THEN '%s'\n"
362 " WHEN p.proiswindow THEN '%s'\n"
363 " WHEN p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype THEN '%s'\n"
379 " WHEN p.provolatile = 'i' THEN '%s'\n"
380 " WHEN p.provolatile = 's' THEN '%s'\n"
381 " WHEN p.provolatile = 'v' THEN '%s'\n"
390 " WHEN p.proparallel = 'r' THEN '%s'\n"
391 " WHEN p.proparallel = 's' THEN '%s'\n"
392 " WHEN p.proparallel = 'u' THEN '%s'\n"
399 ",\n pg_catalog.pg_get_userbyid(p.proowner) as \"%s\""
400 ",\n CASE WHEN prosecdef THEN '%s' ELSE '%s' END AS \"%s\"",
408 ",\n l.lanname as \"%s\"",
411 ",\n CASE WHEN l.lanname IN ('internal', 'c') THEN p.prosrc END as \"%s\"",
414 ",\n pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"",
419 "\nFROM pg_catalog.pg_proc p"
420 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n");
422 for (
int i = 0;
i < num_arg_patterns;
i++)
425 " LEFT JOIN pg_catalog.pg_type t%d ON t%d.oid = p.proargtypes[%d]\n"
426 " LEFT JOIN pg_catalog.pg_namespace nt%d ON nt%d.oid = t%d.typnamespace\n",
432 " LEFT JOIN pg_catalog.pg_language l ON l.oid = p.prolang\n");
437 if (showNormal && showAggregate && showProcedure && showTrigger && showWindow)
494 bool needs_or =
false;
512 "p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype\n");
535 "n.nspname",
"p.proname", NULL,
536 "pg_catalog.pg_function_is_visible(p.oid)",
540 for (
int i = 0;
i < num_arg_patterns;
i++)
542 if (strcmp(arg_patterns[
i],
"-") != 0)
554 snprintf(nspname,
sizeof(nspname),
"nt%d.nspname",
i);
557 "pg_catalog.format_type(t%d.oid, NULL)",
i);
559 "pg_catalog.pg_type_is_visible(t%d.oid)",
i);
574 if (!showSystem && !func_pattern)
576 " AND n.nspname <> 'information_schema'\n");
585 myopt.
title =
_(
"List of functions");
static const char * map_typename_pattern(const char *pattern)
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, formatPGVersionNumber(), gettext_noop, i, initPQExpBuffer(), lengthof, _psqlSettings::logfile, map_typename_pattern(), printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, snprintf, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, typname, validateSQLNamePattern(), and verbose.
Referenced by exec_command_dfo().
bool describeOperators |
( |
const char * |
oper_pattern, |
|
|
char ** |
arg_patterns, |
|
|
int |
num_arg_patterns, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 770 of file describe.c.
797 "SELECT n.nspname as \"%s\",\n"
798 " o.oprname AS \"%s\",\n"
799 " CASE WHEN o.oprkind='l' THEN NULL ELSE pg_catalog.format_type(o.oprleft, NULL) END AS \"%s\",\n"
800 " CASE WHEN o.oprkind='r' THEN NULL ELSE pg_catalog.format_type(o.oprright, NULL) END AS \"%s\",\n"
801 " pg_catalog.format_type(o.oprresult, NULL) AS \"%s\",\n",
810 " o.oprcode AS \"%s\",\n",
814 " coalesce(pg_catalog.obj_description(o.oid, 'pg_operator'),\n"
815 " pg_catalog.obj_description(o.oprcode, 'pg_proc')) AS \"%s\"\n"
816 "FROM pg_catalog.pg_operator o\n"
817 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = o.oprnamespace\n",
820 if (num_arg_patterns >= 2)
822 num_arg_patterns = 2;
824 " LEFT JOIN pg_catalog.pg_type t0 ON t0.oid = o.oprleft\n"
825 " LEFT JOIN pg_catalog.pg_namespace nt0 ON nt0.oid = t0.typnamespace\n"
826 " LEFT JOIN pg_catalog.pg_type t1 ON t1.oid = o.oprright\n"
827 " LEFT JOIN pg_catalog.pg_namespace nt1 ON nt1.oid = t1.typnamespace\n");
829 else if (num_arg_patterns == 1)
832 " LEFT JOIN pg_catalog.pg_type t0 ON t0.oid = o.oprright\n"
833 " LEFT JOIN pg_catalog.pg_namespace nt0 ON nt0.oid = t0.typnamespace\n");
836 if (!showSystem && !oper_pattern)
838 " AND n.nspname <> 'information_schema'\n");
841 !showSystem && !oper_pattern,
true,
842 "n.nspname",
"o.oprname", NULL,
843 "pg_catalog.pg_operator_is_visible(o.oid)",
847 if (num_arg_patterns == 1)
850 for (
int i = 0;
i < num_arg_patterns;
i++)
852 if (strcmp(arg_patterns[
i],
"-") != 0)
864 snprintf(nspname,
sizeof(nspname),
"nt%d.nspname",
i);
867 "pg_catalog.format_type(t%d.oid, NULL)",
i);
869 "pg_catalog.pg_type_is_visible(t%d.oid)",
i);
891 myopt.
title =
_(
"List of operators");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, i, initPQExpBuffer(), _psqlSettings::logfile, map_typename_pattern(), _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, snprintf, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, typname, validateSQLNamePattern(), and verbose.
Referenced by exec_command_dfo().
bool describePublications |
( |
const char * |
pattern | ) |
|
Definition at line 6391 of file describe.c.
6396 bool has_pubtruncate;
6397 bool has_pubviaroot;
6406 pg_log_error(
"The server (version %s) does not support publications.",
6408 sverbuf,
sizeof(sverbuf)));
6418 "SELECT oid, pubname,\n"
6419 " pg_catalog.pg_get_userbyid(pubowner) AS owner,\n"
6420 " puballtables, pubinsert, pubupdate, pubdelete");
6421 if (has_pubtruncate)
6428 "\nFROM pg_catalog.pg_publication\n");
6431 NULL,
"pubname", NULL,
6453 pg_log_error(
"Did not find any publication named \"%s\".",
6466 const char align =
'l';
6474 if (has_pubtruncate)
6488 if (has_pubtruncate)
6498 if (has_pubtruncate)
6507 "SELECT n.nspname, c.relname");
6511 ", pg_get_expr(pr.prqual, c.oid)");
6513 ", (CASE WHEN pr.prattrs IS NOT NULL THEN\n"
6514 " pg_catalog.array_to_string("
6515 " ARRAY(SELECT attname\n"
6517 " pg_catalog.generate_series(0, pg_catalog.array_upper(pr.prattrs::pg_catalog.int2[], 1)) s,\n"
6518 " pg_catalog.pg_attribute\n"
6519 " WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n"
6526 "\nFROM pg_catalog.pg_class c,\n"
6527 " pg_catalog.pg_namespace n,\n"
6528 " pg_catalog.pg_publication_rel pr\n"
6529 "WHERE c.relnamespace = n.oid\n"
6530 " AND c.oid = pr.prrelid\n"
6531 " AND pr.prpubid = '%s'\n"
6532 "ORDER BY 1,2", pubid);
6540 "SELECT n.nspname\n"
6541 "FROM pg_catalog.pg_namespace n\n"
6542 " JOIN pg_catalog.pg_publication_namespace pn ON n.oid = pn.pnnspid\n"
6543 "WHERE pn.pnpubid = '%s'\n"
6544 "ORDER BY 1", pubid);
static bool addFooterToPublicationDesc(PQExpBuffer buf, const char *footermsg, bool as_schema, printTableContent *const cont)
int PQntuples(const PGresult *res)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
void printTableInit(printTableContent *const content, const printTableOpt *opt, const char *title, const int ncolumns, const int nrows)
void printTableCleanup(printTableContent *const content)
void printTableAddCell(printTableContent *const content, char *cell, const bool translate, const bool mustfree)
void printTable(const printTableContent *cont, FILE *fout, bool is_pager, FILE *flog)
void printTableAddHeader(printTableContent *const content, char *header, const bool translate, const char align)
References _, addFooterToPublicationDesc(), appendPQExpBuffer(), appendPQExpBufferStr(), buf, PQExpBufferData::data, formatPGVersionNumber(), gettext_noop, i, initPQExpBuffer(), _psqlSettings::logfile, pg_log_error, _psqlSettings::popt, PQclear(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), printTable(), printTableAddCell(), printTableAddHeader(), printTableCleanup(), printTableInit(), pset, PSQLexec(), _psqlSettings::queryFout, _psqlSettings::quiet, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::topt, and validateSQLNamePattern().
Referenced by exec_command_d().
bool describeRoleGrants |
( |
const char * |
pattern, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 3882 of file describe.c.
3890 "SELECT m.rolname AS \"%s\", r.rolname AS \"%s\",\n"
3891 " pg_catalog.concat_ws(', ',\n",
3897 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3898 " CASE WHEN pam.inherit_option THEN 'INHERIT' END,\n"
3899 " CASE WHEN pam.set_option THEN 'SET' END\n");
3902 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3903 " CASE WHEN m.rolinherit THEN 'INHERIT' END,\n"
3908 " g.rolname AS \"%s\"\n",
3913 "FROM pg_catalog.pg_roles m\n"
3914 " JOIN pg_catalog.pg_auth_members pam ON (pam.member = m.oid)\n"
3915 " LEFT JOIN pg_catalog.pg_roles r ON (pam.roleid = r.oid)\n"
3916 " LEFT JOIN pg_catalog.pg_roles g ON (pam.grantor = g.oid)\n");
3918 if (!showSystem && !pattern)
3922 NULL,
"m.rolname", NULL, NULL,
3936 myopt.
title =
_(
"List of role grants");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool describeRoles |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 3666 of file describe.c.
3676 const char align =
'l';
3684 "SELECT r.rolname, r.rolsuper, r.rolinherit,\n"
3685 " r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,\n"
3686 " r.rolconnlimit, r.rolvaliduntil");
3702 if (!showSystem && !pattern)
3706 NULL,
"r.rolname", NULL, NULL,
3720 attr =
pg_malloc0((nrows + 1) *
sizeof(*attr));
3730 for (
i = 0;
i < nrows;
i++)
3792 for (
i = 0;
i < nrows;
i++)
#define ngettext(s, p, n)
static void add_role_attribute(PQExpBuffer buf, const char *const str)
void * pg_malloc0(size_t size)
char * pg_strdup(const char *in)
static IsoConnInfo * conns
void resetPQExpBuffer(PQExpBuffer str)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
References _, add_role_attribute(), appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), buf, conns, printTableOpt::default_footer, free, gettext_noop, i, initPQExpBuffer(), _psqlSettings::logfile, ngettext, pg_malloc0(), pg_strdup(), _psqlSettings::popt, PQclear(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), printTable(), printTableAddCell(), printTableAddHeader(), printTableCleanup(), printTableInit(), pset, PSQLexec(), _psqlSettings::queryFout, res, resetPQExpBuffer(), _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::topt, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool describeSubscriptions |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 6577 of file describe.c.
6582 static const bool translate_columns[] = {
false,
false,
false,
false,
6583 false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
6590 pg_log_error(
"The server (version %s) does not support subscriptions.",
6592 sverbuf,
sizeof(sverbuf)));
6599 "SELECT subname AS \"%s\"\n"
6600 ", pg_catalog.pg_get_userbyid(subowner) AS \"%s\"\n"
6601 ", subenabled AS \"%s\"\n"
6602 ", subpublications AS \"%s\"\n",
6614 ", subbinary AS \"%s\"\n",
6619 ", (CASE substream\n"
6620 " WHEN 'f' THEN 'off'\n"
6621 " WHEN 't' THEN 'on'\n"
6622 " WHEN 'p' THEN 'parallel'\n"
6623 " END) AS \"%s\"\n",
6627 ", substream AS \"%s\"\n",
6634 ", subtwophasestate AS \"%s\"\n"
6635 ", subdisableonerr AS \"%s\"\n",
6641 ", suborigin AS \"%s\"\n"
6642 ", subpasswordrequired AS \"%s\"\n"
6643 ", subrunasowner AS \"%s\"\n",
6650 ", subfailover AS \"%s\"\n",
6654 ", subsynccommit AS \"%s\"\n"
6655 ", subconninfo AS \"%s\"\n",
6662 ", subskiplsn AS \"%s\"\n",
6668 "FROM pg_catalog.pg_subscription\n"
6669 "WHERE subdbid = (SELECT oid\n"
6670 " FROM pg_catalog.pg_database\n"
6671 " WHERE datname = pg_catalog.current_database())");
6674 NULL,
"subname", NULL,
6689 myopt.
title =
_(
"List of subscriptions");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, formatPGVersionNumber(), gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool describeTableDetails |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 1445 of file describe.c.
1457 "FROM pg_catalog.pg_class c\n"
1458 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n");
1460 if (!showSystem && !pattern)
1462 " AND n.nspname <> 'information_schema'\n");
1465 "n.nspname",
"c.relname", NULL,
1466 "pg_catalog.pg_table_is_visible(c.oid)",
1485 pg_log_error(
"Did not find any relation named \"%s\".",
1497 const char *nspname;
static bool describeOneTableDetails(const char *schemaname, const char *relationname, const char *oid, bool verbose)
volatile sig_atomic_t cancel_pressed
References appendPQExpBufferStr(), buf, cancel_pressed, describeOneTableDetails(), i, initPQExpBuffer(), pg_log_error, PQclear(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), pset, PSQLexec(), _psqlSettings::quiet, relname, res, termPQExpBuffer(), validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool describeTablespaces |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 215 of file describe.c.
224 "SELECT spcname AS \"%s\",\n"
225 " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
226 " pg_catalog.pg_tablespace_location(oid) AS \"%s\"",
236 ",\n spcoptions AS \"%s\""
237 ",\n pg_catalog.pg_size_pretty(pg_catalog.pg_tablespace_size(oid)) AS \"%s\""
238 ",\n pg_catalog.shobj_description(oid, 'pg_tablespace') AS \"%s\"",
245 "\nFROM pg_catalog.pg_tablespace\n");
248 NULL,
"spcname", NULL,
263 myopt.
title =
_(
"List of tablespaces");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool describeTypes |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 615 of file describe.c.
624 "SELECT n.nspname as \"%s\",\n"
625 " pg_catalog.format_type(t.oid, NULL) AS \"%s\",\n",
631 " t.typname AS \"%s\",\n"
632 " CASE WHEN t.typrelid != 0\n"
633 " THEN CAST('tuple' AS pg_catalog.text)\n"
634 " WHEN t.typlen < 0\n"
635 " THEN CAST('var' AS pg_catalog.text)\n"
636 " ELSE CAST(t.typlen AS pg_catalog.text)\n"
638 " pg_catalog.array_to_string(\n"
640 " SELECT e.enumlabel\n"
641 " FROM pg_catalog.pg_enum e\n"
642 " WHERE e.enumtypid = t.oid\n"
643 " ORDER BY e.enumsortorder\n"
647 " pg_catalog.pg_get_userbyid(t.typowner) AS \"%s\",\n",
657 " pg_catalog.obj_description(t.oid, 'pg_type') as \"%s\"\n",
661 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
669 " FROM pg_catalog.pg_class c "
670 "WHERE c.oid = t.typrelid))\n");
675 if (pattern == NULL || strstr(pattern,
"[]") == NULL)
676 appendPQExpBufferStr(&
buf,
" AND NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type el WHERE el.oid = t.typelem AND el.typarray = t.oid)\n");
678 if (!showSystem && !pattern)
680 " AND n.nspname <> 'information_schema'\n");
685 "n.nspname",
"t.typname",
686 "pg_catalog.format_type(t.oid, NULL)",
687 "pg_catalog.pg_type_is_visible(t.oid)",
701 myopt.
title =
_(
"List of data types");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, CppAsString2, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, map_typename_pattern(), _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listAllDbs |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 911 of file describe.c.
921 " d.datname as \"%s\",\n"
922 " pg_catalog.pg_get_userbyid(d.datdba) as \"%s\",\n"
923 " pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\",\n",
929 " CASE d.datlocprovider WHEN 'b' THEN 'builtin' WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS \"%s\",\n",
933 " 'libc' AS \"%s\",\n",
936 " d.datcollate as \"%s\",\n"
937 " d.datctype as \"%s\",\n",
942 " d.datlocale as \"%s\",\n",
946 " d.daticulocale as \"%s\",\n",
950 " NULL as \"%s\",\n",
954 " d.daticurules as \"%s\",\n",
958 " NULL as \"%s\",\n",
964 ",\n CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')\n"
965 " THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname))\n"
966 " ELSE 'No Access'\n"
968 ",\n t.spcname as \"%s\""
969 ",\n pg_catalog.shobj_description(d.oid, 'pg_database') as \"%s\"",
974 "\nFROM pg_catalog.pg_database d\n");
977 " JOIN pg_catalog.pg_tablespace t on d.dattablespace = t.oid\n");
982 NULL,
"d.datname", NULL, NULL,
996 myopt.
title =
_(
"List of databases");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_list(), and main().
bool listCasts |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 4842 of file describe.c.
4847 static const bool translate_columns[] = {
false,
false,
false,
true,
false};
4852 "SELECT pg_catalog.format_type(castsource, NULL) AS \"%s\",\n"
4853 " pg_catalog.format_type(casttarget, NULL) AS \"%s\",\n",
4863 " CASE WHEN c.castmethod = '%c' THEN '(binary coercible)'\n"
4864 " WHEN c.castmethod = '%c' THEN '(with inout)'\n"
4866 " END AS \"%s\",\n",
4867 COERCION_METHOD_BINARY,
4868 COERCION_METHOD_INOUT,
4872 " CASE WHEN c.castcontext = '%c' THEN '%s'\n"
4873 " WHEN c.castcontext = '%c' THEN '%s'\n"
4876 COERCION_CODE_EXPLICIT,
4878 COERCION_CODE_ASSIGNMENT,
4885 ",\n d.description AS \"%s\"",
4893 "\nFROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p\n"
4894 " ON c.castfunc = p.oid\n"
4895 " LEFT JOIN pg_catalog.pg_type ts\n"
4896 " ON c.castsource = ts.oid\n"
4897 " LEFT JOIN pg_catalog.pg_namespace ns\n"
4898 " ON ns.oid = ts.typnamespace\n"
4899 " LEFT JOIN pg_catalog.pg_type tt\n"
4900 " ON c.casttarget = tt.oid\n"
4901 " LEFT JOIN pg_catalog.pg_namespace nt\n"
4902 " ON nt.oid = tt.typnamespace\n");
4906 " LEFT JOIN pg_catalog.pg_description d\n"
4907 " ON d.classoid = c.tableoid AND d.objoid = "
4908 "c.oid AND d.objsubid = 0\n");
4917 "ns.nspname",
"ts.typname",
4918 "pg_catalog.format_type(ts.oid, NULL)",
4919 "pg_catalog.pg_type_is_visible(ts.oid)",
4926 "nt.nspname",
"tt.typname",
4927 "pg_catalog.format_type(tt.oid, NULL)",
4928 "pg_catalog.pg_type_is_visible(tt.oid)",
4939 myopt.
title =
_(
"List of casts");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listCollations |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 4960 of file describe.c.
4965 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
true,
false};
4971 " n.nspname AS \"%s\",\n"
4972 " c.collname AS \"%s\",\n",
4978 " CASE c.collprovider WHEN 'd' THEN 'default' WHEN 'b' THEN 'builtin' WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS \"%s\",\n",
4982 " 'libc' AS \"%s\",\n",
4986 " c.collcollate AS \"%s\",\n"
4987 " c.collctype AS \"%s\",\n",
4993 " c.colllocale AS \"%s\",\n",
4997 " c.colliculocale AS \"%s\",\n",
5001 " c.collcollate AS \"%s\",\n",
5006 " c.collicurules AS \"%s\",\n",
5010 " NULL AS \"%s\",\n",
5015 " CASE WHEN c.collisdeterministic THEN '%s' ELSE '%s' END AS \"%s\"",
5026 ",\n pg_catalog.obj_description(c.oid, 'pg_collation') AS \"%s\"",
5030 "\nFROM pg_catalog.pg_collation c, pg_catalog.pg_namespace n\n"
5031 "WHERE n.oid = c.collnamespace\n");
5033 if (!showSystem && !pattern)
5035 " AND n.nspname <> 'information_schema'\n");
5043 appendPQExpBufferStr(&
buf,
" AND c.collencoding IN (-1, pg_catalog.pg_char_to_encoding(pg_catalog.getdatabaseencoding()))\n");
5046 "n.nspname",
"c.collname", NULL,
5047 "pg_catalog.pg_collation_is_visible(c.oid)",
5061 myopt.
title =
_(
"List of collations");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listConversions |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 4518 of file describe.c.
4523 static const bool translate_columns[] =
4524 {
false,
false,
false,
false,
true,
false};
4529 "SELECT n.nspname AS \"%s\",\n"
4530 " c.conname AS \"%s\",\n"
4531 " pg_catalog.pg_encoding_to_char(c.conforencoding) AS \"%s\",\n"
4532 " pg_catalog.pg_encoding_to_char(c.contoencoding) AS \"%s\",\n"
4533 " CASE WHEN c.condefault THEN '%s'\n"
4534 " ELSE '%s' END AS \"%s\"",
4544 ",\n d.description AS \"%s\"",
4548 "\nFROM pg_catalog.pg_conversion c\n"
4549 " JOIN pg_catalog.pg_namespace n "
4550 "ON n.oid = c.connamespace\n");
4554 "LEFT JOIN pg_catalog.pg_description d "
4555 "ON d.classoid = c.tableoid\n"
4556 " AND d.objoid = c.oid "
4557 "AND d.objsubid = 0\n");
4561 if (!showSystem && !pattern)
4563 " AND n.nspname <> 'information_schema'\n");
4566 "n.nspname",
"c.conname", NULL,
4567 "pg_catalog.pg_conversion_is_visible(c.oid)",
4581 myopt.
title =
_(
"List of conversions");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listDbRoleSettings |
( |
const char * |
pattern, |
|
|
const char * |
pattern2 |
|
) |
| |
Definition at line 3813 of file describe.c.
3823 "pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
3824 "FROM pg_catalog.pg_db_role_setting s\n"
3825 "LEFT JOIN pg_catalog.pg_database d ON d.oid = setdatabase\n"
3826 "LEFT JOIN pg_catalog.pg_roles r ON r.oid = setrole\n",
3831 NULL,
"r.rolname", NULL, NULL, &havewhere, 1))
3834 NULL,
"d.datname", NULL, NULL,
3852 if (pattern && pattern2)
3853 pg_log_error(
"Did not find any settings for role \"%s\" and database \"%s\".",
3856 pg_log_error(
"Did not find any settings for role \"%s\".",
3863 myopt.
title =
_(
"List of settings");
References _, appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, pg_log_error, _psqlSettings::popt, PQclear(), PQntuples(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, _psqlSettings::quiet, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool listDefaultACLs |
( |
const char * |
pattern | ) |
|
Definition at line 1175 of file describe.c.
1180 static const bool translate_columns[] = {
false,
false,
true,
false};
1185 "SELECT pg_catalog.pg_get_userbyid(d.defaclrole) AS \"%s\",\n"
1186 " n.nspname AS \"%s\",\n"
1187 " CASE d.defaclobjtype WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' END AS \"%s\",\n"
1199 DEFACLOBJ_NAMESPACE,
1206 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.defaclnamespace\n");
1211 "pg_catalog.pg_get_userbyid(d.defaclrole)",
References _, appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool listDomains |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 4435 of file describe.c.
4444 "SELECT n.nspname as \"%s\",\n"
4445 " t.typname as \"%s\",\n"
4446 " pg_catalog.format_type(t.typbasetype, t.typtypmod) as \"%s\",\n"
4447 " (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type bt\n"
4448 " WHERE c.oid = t.typcollation AND bt.oid = t.typbasetype AND t.typcollation <> bt.typcollation) as \"%s\",\n"
4449 " CASE WHEN t.typnotnull THEN 'not null' END as \"%s\",\n"
4450 " t.typdefault as \"%s\",\n"
4451 " pg_catalog.array_to_string(ARRAY(\n"
4452 " SELECT pg_catalog.pg_get_constraintdef(r.oid, true) FROM pg_catalog.pg_constraint r WHERE t.oid = r.contypid AND r.contype = 'c' ORDER BY r.conname\n"
4453 " ), ' ') as \"%s\"",
4467 ",\n d.description as \"%s\"",
4472 "\nFROM pg_catalog.pg_type t\n"
4473 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
4477 " LEFT JOIN pg_catalog.pg_description d "
4478 "ON d.classoid = t.tableoid AND d.objoid = t.oid "
4479 "AND d.objsubid = 0\n");
4483 if (!showSystem && !pattern)
4485 " AND n.nspname <> 'information_schema'\n");
4488 "n.nspname",
"t.typname", NULL,
4489 "pg_catalog.pg_type_is_visible(t.oid)",
4503 myopt.
title =
_(
"List of domains");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listEventTriggers |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 4666 of file describe.c.
4671 static const bool translate_columns[] =
4672 {
false,
false,
false,
true,
false,
false,
false};
4678 pg_log_error(
"The server (version %s) does not support event triggers.",
4680 sverbuf,
sizeof(sverbuf)));
4687 "SELECT evtname as \"%s\", "
4688 "evtevent as \"%s\", "
4689 "pg_catalog.pg_get_userbyid(e.evtowner) as \"%s\",\n"
4690 " case evtenabled when 'O' then '%s'"
4691 " when 'R' then '%s'"
4692 " when 'A' then '%s'"
4693 " when 'D' then '%s' end as \"%s\",\n"
4694 " e.evtfoid::pg_catalog.regproc as \"%s\", "
4695 "pg_catalog.array_to_string(array(select x"
4696 " from pg_catalog.unnest(evttags) as t(x)), ', ') as \"%s\"",
4709 ",\npg_catalog.obj_description(e.oid, 'pg_event_trigger') as \"%s\"",
4712 "\nFROM pg_catalog.pg_event_trigger e ");
4715 NULL,
"evtname", NULL, NULL,
4729 myopt.
title =
_(
"List of event triggers");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, formatPGVersionNumber(), gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listExtendedStats |
( |
const char * |
pattern | ) |
|
Definition at line 4746 of file describe.c.
4756 pg_log_error(
"The server (version %s) does not support extended statistics.",
4758 sverbuf,
sizeof(sverbuf)));
4765 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text AS \"%s\", \n"
4766 "es.stxname AS \"%s\", \n",
4772 "pg_catalog.format('%%s FROM %%s', \n"
4773 " pg_catalog.pg_get_statisticsobjdef_columns(es.oid), \n"
4774 " es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4778 "pg_catalog.format('%%s FROM %%s', \n"
4779 " (SELECT pg_catalog.string_agg(pg_catalog.quote_ident(a.attname),', ') \n"
4780 " FROM pg_catalog.unnest(es.stxkeys) s(attnum) \n"
4781 " JOIN pg_catalog.pg_attribute a \n"
4782 " ON (es.stxrelid = a.attrelid \n"
4783 " AND a.attnum = s.attnum \n"
4784 " AND NOT a.attisdropped)), \n"
4785 "es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4789 ",\nCASE WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
4791 "CASE WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
4802 ",\nCASE WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
4808 " \nFROM pg_catalog.pg_statistic_ext es \n");
4812 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text",
"es.stxname",
4813 NULL,
"pg_catalog.pg_statistics_obj_is_visible(es.oid)",
4827 myopt.
title =
_(
"List of extended statistics");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, formatPGVersionNumber(), gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, pg_log_error, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool listExtensionContents |
( |
const char * |
pattern | ) |
|
Definition at line 6105 of file describe.c.
6113 "SELECT e.extname, e.oid\n"
6114 "FROM pg_catalog.pg_extension e\n");
6118 NULL,
"e.extname", NULL,
6138 pg_log_error(
"Did not find any extension named \"%s\".",
6149 const char *extname;
static bool listOneExtensionContents(const char *extname, const char *oid)
References appendPQExpBufferStr(), buf, cancel_pressed, i, initPQExpBuffer(), listOneExtensionContents(), pg_log_error, PQclear(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), pset, PSQLexec(), _psqlSettings::quiet, res, termPQExpBuffer(), and validateSQLNamePattern().
Referenced by exec_command_d().
bool listExtensions |
( |
const char * |
pattern | ) |
|
Definition at line 6054 of file describe.c.
6062 "SELECT e.extname AS \"%s\", "
6063 "e.extversion AS \"%s\", n.nspname AS \"%s\", c.description AS \"%s\"\n"
6064 "FROM pg_catalog.pg_extension e "
6065 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace "
6066 "LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid "
6067 "AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n",
6075 NULL,
"e.extname", NULL,
6090 myopt.
title =
_(
"List of installed extensions");
References _, appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool listForeignDataWrappers |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5780 of file describe.c.
5788 "SELECT fdw.fdwname AS \"%s\",\n"
5789 " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n"
5790 " fdw.fdwhandler::pg_catalog.regproc AS \"%s\",\n"
5791 " fdw.fdwvalidator::pg_catalog.regproc AS \"%s\"",
5802 ",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
5803 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5804 " pg_catalog.quote_ident(option_name) || ' ' || "
5805 " pg_catalog.quote_literal(option_value) FROM "
5806 " pg_catalog.pg_options_to_table(fdwoptions)), ', ') || ')' "
5808 ",\n d.description AS \"%s\" ",
5817 "LEFT JOIN pg_catalog.pg_description d\n"
5818 " ON d.classoid = fdw.tableoid "
5819 "AND d.objoid = fdw.oid AND d.objsubid = 0\n");
5822 NULL,
"fdwname", NULL, NULL,
5836 myopt.
title =
_(
"List of foreign-data wrappers");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listForeignServers |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5851 of file describe.c.
5859 "SELECT s.srvname AS \"%s\",\n"
5860 " pg_catalog.pg_get_userbyid(s.srvowner) AS \"%s\",\n"
5861 " f.fdwname AS \"%s\"",
5872 " s.srvtype AS \"%s\",\n"
5873 " s.srvversion AS \"%s\",\n"
5874 " CASE WHEN srvoptions IS NULL THEN '' ELSE "
5875 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5876 " pg_catalog.quote_ident(option_name) || ' ' || "
5877 " pg_catalog.quote_literal(option_value) FROM "
5878 " pg_catalog.pg_options_to_table(srvoptions)), ', ') || ')' "
5880 " d.description AS \"%s\"",
5888 "\nFROM pg_catalog.pg_foreign_server s\n"
5889 " JOIN pg_catalog.pg_foreign_data_wrapper f ON f.oid=s.srvfdw\n");
5893 "LEFT JOIN pg_catalog.pg_description d\n "
5894 "ON d.classoid = s.tableoid AND d.objoid = s.oid "
5895 "AND d.objsubid = 0\n");
5898 NULL,
"s.srvname", NULL, NULL,
5912 myopt.
title =
_(
"List of foreign servers");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listForeignTables |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5982 of file describe.c.
5990 "SELECT n.nspname AS \"%s\",\n"
5991 " c.relname AS \"%s\",\n"
5992 " s.srvname AS \"%s\"",
5999 ",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
6000 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
6001 " pg_catalog.quote_ident(option_name) || ' ' || "
6002 " pg_catalog.quote_literal(option_value) FROM "
6003 " pg_catalog.pg_options_to_table(ftoptions)), ', ') || ')' "
6005 " d.description AS \"%s\"",
6010 "\nFROM pg_catalog.pg_foreign_table ft\n"
6011 " INNER JOIN pg_catalog.pg_class c"
6012 " ON c.oid = ft.ftrelid\n"
6013 " INNER JOIN pg_catalog.pg_namespace n"
6014 " ON n.oid = c.relnamespace\n"
6015 " INNER JOIN pg_catalog.pg_foreign_server s"
6016 " ON s.oid = ft.ftserver\n");
6019 " LEFT JOIN pg_catalog.pg_description d\n"
6020 " ON d.classoid = c.tableoid AND "
6021 "d.objoid = c.oid AND d.objsubid = 0\n");
6024 "n.nspname",
"c.relname", NULL,
6025 "pg_catalog.pg_table_is_visible(c.oid)",
6039 myopt.
title =
_(
"List of foreign tables");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listLanguages |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 4359 of file describe.c.
4368 "SELECT l.lanname AS \"%s\",\n"
4369 " pg_catalog.pg_get_userbyid(l.lanowner) as \"%s\",\n"
4370 " l.lanpltrusted AS \"%s\"",
4378 ",\n NOT l.lanispl AS \"%s\",\n"
4379 " l.lanplcallfoid::pg_catalog.regprocedure AS \"%s\",\n"
4380 " l.lanvalidator::pg_catalog.regprocedure AS \"%s\",\n "
4381 "l.laninline::pg_catalog.regprocedure AS \"%s\",\n ",
4390 ",\n d.description AS \"%s\""
4391 "\nFROM pg_catalog.pg_language l\n"
4392 "LEFT JOIN pg_catalog.pg_description d\n"
4393 " ON d.classoid = l.tableoid AND d.objoid = l.oid\n"
4394 " AND d.objsubid = 0\n",
4400 NULL,
"l.lanname", NULL, NULL,
4408 if (!showSystem && !pattern)
4419 myopt.
title =
_(
"List of languages");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
Definition at line 7106 of file describe.c.
7115 "SELECT oid as \"%s\",\n"
7116 " pg_catalog.pg_get_userbyid(lomowner) as \"%s\",\n ",
7127 "pg_catalog.obj_description(oid, 'pg_largeobject') as \"%s\"\n"
7128 "FROM pg_catalog.pg_largeobject_metadata\n"
7137 myopt.
title =
_(
"Large objects");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, and verbose.
Referenced by exec_command_d(), and exec_command_lo().
bool listOperatorClasses |
( |
const char * |
access_method_pattern, |
|
|
const char * |
type_pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 6729 of file describe.c.
6735 bool have_where =
false;
6736 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false};
6742 " am.amname AS \"%s\",\n"
6743 " pg_catalog.format_type(c.opcintype, NULL) AS \"%s\",\n"
6745 " WHEN c.opckeytype <> 0 AND c.opckeytype <> c.opcintype\n"
6746 " THEN pg_catalog.format_type(c.opckeytype, NULL)\n"
6750 " WHEN pg_catalog.pg_opclass_is_visible(c.oid)\n"
6751 " THEN pg_catalog.format('%%I', c.opcname)\n"
6752 " ELSE pg_catalog.format('%%I.%%I', n.nspname, c.opcname)\n"
6754 " (CASE WHEN c.opcdefault\n"
6768 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6769 " THEN pg_catalog.format('%%I', of.opfname)\n"
6770 " ELSE pg_catalog.format('%%I.%%I', ofn.nspname, of.opfname)\n"
6772 " pg_catalog.pg_get_userbyid(c.opcowner) AS \"%s\"\n",
6776 "\nFROM pg_catalog.pg_opclass c\n"
6777 " LEFT JOIN pg_catalog.pg_am am on am.oid = c.opcmethod\n"
6778 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.opcnamespace\n"
6779 " LEFT JOIN pg_catalog.pg_type t ON t.oid = c.opcintype\n"
6780 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n");
6783 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = c.opcfamily\n"
6784 " LEFT JOIN pg_catalog.pg_namespace ofn ON ofn.oid = of.opfnamespace\n");
6786 if (access_method_pattern)
6788 false,
false, NULL,
"am.amname", NULL, NULL,
6795 "tn.nspname",
"t.typname",
6796 "pg_catalog.format_type(t.oid, NULL)",
6797 "pg_catalog.pg_type_is_visible(t.oid)",
6808 myopt.
title =
_(
"List of operator classes");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listOperatorFamilies |
( |
const char * |
access_method_pattern, |
|
|
const char * |
type_pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 6830 of file describe.c.
6836 bool have_where =
false;
6837 static const bool translate_columns[] = {
false,
false,
false,
false};
6843 " am.amname AS \"%s\",\n"
6845 " WHEN pg_catalog.pg_opfamily_is_visible(f.oid)\n"
6846 " THEN pg_catalog.format('%%I', f.opfname)\n"
6847 " ELSE pg_catalog.format('%%I.%%I', n.nspname, f.opfname)\n"
6850 " pg_catalog.string_agg(pg_catalog.format_type(oc.opcintype, NULL), ', ')\n"
6851 " FROM pg_catalog.pg_opclass oc\n"
6852 " WHERE oc.opcfamily = f.oid) \"%s\"",
6858 ",\n pg_catalog.pg_get_userbyid(f.opfowner) AS \"%s\"\n",
6861 "\nFROM pg_catalog.pg_opfamily f\n"
6862 " LEFT JOIN pg_catalog.pg_am am on am.oid = f.opfmethod\n"
6863 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = f.opfnamespace\n");
6865 if (access_method_pattern)
6867 false,
false, NULL,
"am.amname", NULL, NULL,
6875 " FROM pg_catalog.pg_type t\n"
6876 " JOIN pg_catalog.pg_opclass oc ON oc.opcintype = t.oid\n"
6877 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n"
6878 " WHERE oc.opcfamily = f.oid\n",
6879 have_where ?
"AND" :
"WHERE");
6882 "tn.nspname",
"t.typname",
6883 "pg_catalog.format_type(t.oid, NULL)",
6884 "pg_catalog.pg_type_is_visible(t.oid)",
6896 myopt.
title =
_(
"List of operator families");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listOpFamilyFunctions |
( |
const char * |
access_method_pattern, |
|
|
const char * |
family_pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 7017 of file describe.c.
7023 bool have_where =
false;
7024 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
7030 " am.amname AS \"%s\",\n"
7032 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
7033 " THEN pg_catalog.format('%%I', of.opfname)\n"
7034 " ELSE pg_catalog.format('%%I.%%I', ns.nspname, of.opfname)\n"
7036 " pg_catalog.format_type(ap.amproclefttype, NULL) AS \"%s\",\n"
7037 " pg_catalog.format_type(ap.amprocrighttype, NULL) AS \"%s\",\n"
7038 " ap.amprocnum AS \"%s\"\n",
7047 ", p.proname AS \"%s\"\n",
7051 ", ap.amproc::pg_catalog.regprocedure AS \"%s\"\n",
7055 "FROM pg_catalog.pg_amproc ap\n"
7056 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = ap.amprocfamily\n"
7057 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod\n"
7058 " LEFT JOIN pg_catalog.pg_namespace ns ON of.opfnamespace = ns.oid\n"
7059 " LEFT JOIN pg_catalog.pg_proc p ON ap.amproc = p.oid\n");
7061 if (access_method_pattern)
7064 false,
false, NULL,
"am.amname",
7072 "ns.nspname",
"of.opfname", NULL, NULL,
7078 " ap.amproclefttype = ap.amprocrighttype DESC,\n"
7086 myopt.
title =
_(
"List of support functions of operator families");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listOpFamilyOperators |
( |
const char * |
access_method_pattern, |
|
|
const char * |
family_pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 6919 of file describe.c.
6925 bool have_where =
false;
6927 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
6933 " am.amname AS \"%s\",\n"
6935 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6936 " THEN pg_catalog.format('%%I', of.opfname)\n"
6937 " ELSE pg_catalog.format('%%I.%%I', nsf.nspname, of.opfname)\n"
6939 " o.amopopr::pg_catalog.regoperator AS \"%s\"\n,"
6940 " o.amopstrategy AS \"%s\",\n"
6941 " CASE o.amoppurpose\n"
6942 " WHEN 'o' THEN '%s'\n"
6943 " WHEN 's' THEN '%s'\n"
6955 ", ofs.opfname AS \"%s\"\n",
6958 "FROM pg_catalog.pg_amop o\n"
6959 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = o.amopfamily\n"
6960 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod AND am.oid = o.amopmethod\n"
6961 " LEFT JOIN pg_catalog.pg_namespace nsf ON of.opfnamespace = nsf.oid\n");
6964 " LEFT JOIN pg_catalog.pg_opfamily ofs ON ofs.oid = o.amopsortfamily\n");
6966 if (access_method_pattern)
6969 false,
false, NULL,
"am.amname",
6978 "nsf.nspname",
"of.opfname", NULL, NULL,
6984 " o.amoplefttype = o.amoprighttype DESC,\n"
6985 " pg_catalog.format_type(o.amoplefttype, NULL),\n"
6986 " pg_catalog.format_type(o.amoprighttype, NULL),\n"
6987 " o.amopstrategy;");
6994 myopt.
title =
_(
"List of operators of operator families");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listPartitionedTables |
( |
const char * |
reltypes, |
|
|
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 4159 of file describe.c.
4161 bool showTables = strchr(reltypes,
't') != NULL;
4162 bool showIndexes = strchr(reltypes,
'i') != NULL;
4163 bool showNested = strchr(reltypes,
'n') != NULL;
4168 bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false,
false};
4169 const char *tabletitle;
4170 bool mixed_output =
false;
4179 pg_log_error(
"The server (version %s) does not support declarative table partitioning.",
4181 sverbuf,
sizeof(sverbuf)));
4186 if (!showTables && !showIndexes)
4187 showTables = showIndexes =
true;
4189 if (showIndexes && !showTables)
4190 tabletitle =
_(
"List of partitioned indexes");
4191 else if (showTables && !showIndexes)
4192 tabletitle =
_(
"List of partitioned tables");
4196 tabletitle =
_(
"List of partitioned relations");
4197 mixed_output =
true;
4203 "SELECT n.nspname as \"%s\",\n"
4204 " c.relname as \"%s\",\n"
4205 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
4213 ",\n CASE c.relkind"
4214 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
4215 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
4221 translate_columns[3] =
true;
4224 if (showNested || pattern)
4226 ",\n inh.inhparent::pg_catalog.regclass as \"%s\"",
4231 ",\n c2.oid::pg_catalog.regclass as \"%s\"",
4239 ",\n s.dps as \"%s\"",
4242 ",\n s.tps as \"%s\"",
4248 ",\n s.tps as \"%s\"",
4252 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4257 "\nFROM pg_catalog.pg_class c"
4258 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4262 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4263 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4265 if (showNested || pattern)
4267 "\n LEFT JOIN pg_catalog.pg_inherits inh ON c.oid = inh.inhrelid");
4274 ",\n LATERAL (WITH RECURSIVE d\n"
4275 " AS (SELECT inhrelid AS oid, 1 AS level\n"
4276 " FROM pg_catalog.pg_inherits\n"
4277 " WHERE inhparent = c.oid\n"
4279 " SELECT inhrelid, level + 1\n"
4280 " FROM pg_catalog.pg_inherits i\n"
4281 " JOIN d ON i.inhparent = d.oid)\n"
4282 " SELECT pg_catalog.pg_size_pretty(sum(pg_catalog.pg_table_size("
4283 "d.oid))) AS tps,\n"
4284 " pg_catalog.pg_size_pretty(sum("
4285 "\n CASE WHEN d.level = 1"
4286 " THEN pg_catalog.pg_table_size(d.oid) ELSE 0 END)) AS dps\n"
4293 ",\n LATERAL (SELECT pg_catalog.pg_size_pretty(sum("
4294 "\n CASE WHEN ppt.isleaf AND ppt.level = 1"
4295 "\n THEN pg_catalog.pg_table_size(ppt.relid)"
4296 " ELSE 0 END)) AS dps"
4297 ",\n pg_catalog.pg_size_pretty(sum("
4298 "pg_catalog.pg_table_size(ppt.relid))) AS tps"
4299 "\n FROM pg_catalog.pg_partition_tree(c.oid) ppt) s");
4312 " AND NOT c.relispartition\n" :
"");
4316 " AND n.nspname !~ '^pg_toast'\n"
4317 " AND n.nspname <> 'information_schema'\n");
4320 "n.nspname",
"c.relname", NULL,
4321 "pg_catalog.pg_table_is_visible(c.oid)",
4329 mixed_output ?
"\"Type\" DESC, " :
"",
4330 showNested || pattern ?
"\"Parent name\" NULLS FIRST, " :
"");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, CppAsString2, PQExpBufferData::data, formatPGVersionNumber(), gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listPublications |
( |
const char * |
pattern | ) |
|
Definition at line 6269 of file describe.c.
6274 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false};
6280 pg_log_error(
"The server (version %s) does not support publications.",
6282 sverbuf,
sizeof(sverbuf)));
6289 "SELECT pubname AS \"%s\",\n"
6290 " pg_catalog.pg_get_userbyid(pubowner) AS \"%s\",\n"
6291 " puballtables AS \"%s\",\n"
6292 " pubinsert AS \"%s\",\n"
6293 " pubupdate AS \"%s\",\n"
6294 " pubdelete AS \"%s\"",
6303 ",\n pubtruncate AS \"%s\"",
6307 ",\n pubviaroot AS \"%s\"",
6311 "\nFROM pg_catalog.pg_publication\n");
6314 NULL,
"pubname", NULL,
6329 myopt.
title =
_(
"List of publications");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, formatPGVersionNumber(), gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool listSchemas |
( |
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 5078 of file describe.c.
5083 int pub_schema_tuples = 0;
5084 char **footers = NULL;
5088 "SELECT n.nspname AS \"%s\",\n"
5089 " pg_catalog.pg_get_userbyid(n.nspowner) AS \"%s\"",
5098 ",\n pg_catalog.obj_description(n.oid, 'pg_namespace') AS \"%s\"",
5103 "\nFROM pg_catalog.pg_namespace n\n");
5105 if (!showSystem && !pattern)
5107 "WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'\n");
5110 !showSystem && !pattern,
false,
5111 NULL,
"n.nspname", NULL,
5122 myopt.
title =
_(
"List of schemas");
5132 "FROM pg_catalog.pg_publication p\n"
5133 " JOIN pg_catalog.pg_publication_namespace pn ON p.oid = pn.pnpubid\n"
5134 " JOIN pg_catalog.pg_namespace n ON n.oid = pn.pnnspid \n"
5135 "WHERE n.nspname = '%s'\n"
5144 if (pub_schema_tuples > 0)
5151 footers = (
char **)
pg_malloc((1 + pub_schema_tuples + 1) *
sizeof(
char *));
5155 for (
i = 0;
i < pub_schema_tuples;
i++)
5163 footers[
i + 1] = NULL;
5178 char **footer = NULL;
5180 for (footer = footers; *footer; footer++)
void * pg_malloc(size_t size)
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, printQueryOpt::footers, gettext_noop, i, initPQExpBuffer(), _psqlSettings::logfile, pg_free(), pg_malloc(), pg_strdup(), _psqlSettings::popt, PQclear(), PQgetvalue(), PQntuples(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listTables |
( |
const char * |
tabtypes, |
|
|
const char * |
pattern, |
|
|
bool |
verbose, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 3961 of file describe.c.
3963 bool showTables = strchr(tabtypes,
't') != NULL;
3964 bool showIndexes = strchr(tabtypes,
'i') != NULL;
3965 bool showViews = strchr(tabtypes,
'v') != NULL;
3966 bool showMatViews = strchr(tabtypes,
'm') != NULL;
3967 bool showSeq = strchr(tabtypes,
's') != NULL;
3968 bool showForeign = strchr(tabtypes,
'E') != NULL;
3974 bool translate_columns[] = {
false,
false,
true,
false,
false,
false,
false,
false,
false};
3977 if (!(showTables || showIndexes || showViews || showMatViews || showSeq || showForeign))
3978 showTables = showViews = showMatViews = showSeq = showForeign =
true;
3983 "SELECT n.nspname as \"%s\",\n"
3984 " c.relname as \"%s\",\n"
3992 " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE)
" THEN '%s'"
3993 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
3994 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
3996 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
4015 ",\n c2.relname as \"%s\"",
4026 ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"",
4031 translate_columns[cols_so_far] =
true;
4043 (showTables || showMatViews || showIndexes))
4045 ",\n am.amname as \"%s\"",
4049 ",\n pg_catalog.pg_size_pretty(pg_catalog.pg_table_size(c.oid)) as \"%s\""
4050 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4056 "\nFROM pg_catalog.pg_class c"
4057 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4060 (showTables || showMatViews || showIndexes))
4062 "\n LEFT JOIN pg_catalog.pg_am am ON am.oid = c.relam");
4066 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4067 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4075 if (showSystem || pattern)
4087 if (showSystem || pattern)
4095 if (!showSystem && !pattern)
4097 " AND n.nspname !~ '^pg_toast'\n"
4098 " AND n.nspname <> 'information_schema'\n");
4101 "n.nspname",
"c.relname", NULL,
4102 "pg_catalog.pg_table_is_visible(c.oid)",
4124 pg_log_error(
"Did not find any relation named \"%s\".",
4131 myopt.
title =
_(
"List of relations");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, CppAsString2, gettext_noop, _psqlSettings::hide_tableam, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, pg_log_error, _psqlSettings::popt, PQclear(), PQntuples(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, _psqlSettings::quiet, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listTSConfigs |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5576 of file describe.c.
5589 " n.nspname as \"%s\",\n"
5590 " c.cfgname as \"%s\",\n"
5591 " pg_catalog.obj_description(c.oid, 'pg_ts_config') as \"%s\"\n"
5592 "FROM pg_catalog.pg_ts_config c\n"
5593 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.cfgnamespace\n",
5600 "n.nspname",
"c.cfgname", NULL,
5601 "pg_catalog.pg_ts_config_is_visible(c.oid)",
5615 myopt.
title =
_(
"List of text search configurations");
static bool listTSConfigsVerbose(const char *pattern)
References _, appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), listTSConfigsVerbose(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listTSDictionaries |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5446 of file describe.c.
5456 " n.nspname as \"%s\",\n"
5457 " d.dictname as \"%s\",\n",
5464 " ( SELECT COALESCE(nt.nspname, '(null)')::pg_catalog.text || '.' || t.tmplname FROM\n"
5465 " pg_catalog.pg_ts_template t\n"
5466 " LEFT JOIN pg_catalog.pg_namespace nt ON nt.oid = t.tmplnamespace\n"
5467 " WHERE d.dicttemplate = t.oid ) AS \"%s\",\n"
5468 " d.dictinitoption as \"%s\",\n",
5474 " pg_catalog.obj_description(d.oid, 'pg_ts_dict') as \"%s\"\n",
5478 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.dictnamespace\n");
5481 "n.nspname",
"d.dictname", NULL,
5482 "pg_catalog.pg_ts_dict_is_visible(d.oid)",
5496 myopt.
title =
_(
"List of text search dictionaries");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listTSParsers |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5199 of file describe.c.
5212 " n.nspname as \"%s\",\n"
5213 " p.prsname as \"%s\",\n"
5214 " pg_catalog.obj_description(p.oid, 'pg_ts_parser') as \"%s\"\n"
5215 "FROM pg_catalog.pg_ts_parser p\n"
5216 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.prsnamespace\n",
5223 "n.nspname",
"p.prsname", NULL,
5224 "pg_catalog.pg_ts_parser_is_visible(p.oid)",
5238 myopt.
title =
_(
"List of text search parsers");
static bool listTSParsersVerbose(const char *pattern)
References _, appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), listTSParsersVerbose(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listTSTemplates |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5511 of file describe.c.
5522 " n.nspname AS \"%s\",\n"
5523 " t.tmplname AS \"%s\",\n"
5524 " t.tmplinit::pg_catalog.regproc AS \"%s\",\n"
5525 " t.tmpllexize::pg_catalog.regproc AS \"%s\",\n"
5526 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5535 " n.nspname AS \"%s\",\n"
5536 " t.tmplname AS \"%s\",\n"
5537 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5543 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.tmplnamespace\n");
5546 "n.nspname",
"t.tmplname", NULL,
5547 "pg_catalog.pg_ts_template_is_visible(t.oid)",
5561 myopt.
title =
_(
"List of text search templates");
References _, appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool listUserMappings |
( |
const char * |
pattern, |
|
|
bool |
verbose |
|
) |
| |
Definition at line 5927 of file describe.c.
5935 "SELECT um.srvname AS \"%s\",\n"
5936 " um.usename AS \"%s\"",
5942 ",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
5943 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5944 " pg_catalog.quote_ident(option_name) || ' ' || "
5945 " pg_catalog.quote_literal(option_value) FROM "
5946 " pg_catalog.pg_options_to_table(umoptions)), ', ') || ')' "
5953 NULL,
"um.srvname",
"um.usename", NULL,
5967 myopt.
title =
_(
"List of user mappings");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_header, validateSQLNamePattern(), and verbose.
Referenced by exec_command_d().
bool objectDescription |
( |
const char * |
pattern, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 1252 of file describe.c.
1257 static const bool translate_columns[] = {
false,
false,
true,
false};
1262 "SELECT DISTINCT tt.nspname AS \"%s\", tt.name AS \"%s\", tt.object AS \"%s\", d.description AS \"%s\"\n"
1271 " SELECT pgc.oid as oid, pgc.tableoid AS tableoid,\n"
1272 " n.nspname as nspname,\n"
1273 " CAST(pgc.conname AS pg_catalog.text) as name,"
1274 " CAST('%s' AS pg_catalog.text) as object\n"
1275 " FROM pg_catalog.pg_constraint pgc\n"
1276 " JOIN pg_catalog.pg_class c "
1277 "ON c.oid = pgc.conrelid\n"
1278 " LEFT JOIN pg_catalog.pg_namespace n "
1279 " ON n.oid = c.relnamespace\n",
1282 if (!showSystem && !pattern)
1284 " AND n.nspname <> 'information_schema'\n");
1287 false,
"n.nspname",
"pgc.conname", NULL,
1288 "pg_catalog.pg_table_is_visible(c.oid)",
1295 " SELECT pgc.oid as oid, pgc.tableoid AS tableoid,\n"
1296 " n.nspname as nspname,\n"
1297 " CAST(pgc.conname AS pg_catalog.text) as name,"
1298 " CAST('%s' AS pg_catalog.text) as object\n"
1299 " FROM pg_catalog.pg_constraint pgc\n"
1300 " JOIN pg_catalog.pg_type t "
1301 "ON t.oid = pgc.contypid\n"
1302 " LEFT JOIN pg_catalog.pg_namespace n "
1303 " ON n.oid = t.typnamespace\n",
1306 if (!showSystem && !pattern)
1308 " AND n.nspname <> 'information_schema'\n");
1311 false,
"n.nspname",
"pgc.conname", NULL,
1312 "pg_catalog.pg_type_is_visible(t.oid)",
1319 " SELECT o.oid as oid, o.tableoid as tableoid,\n"
1320 " n.nspname as nspname,\n"
1321 " CAST(o.opcname AS pg_catalog.text) as name,\n"
1322 " CAST('%s' AS pg_catalog.text) as object\n"
1323 " FROM pg_catalog.pg_opclass o\n"
1324 " JOIN pg_catalog.pg_am am ON "
1325 "o.opcmethod = am.oid\n"
1326 " JOIN pg_catalog.pg_namespace n ON "
1327 "n.oid = o.opcnamespace\n",
1330 if (!showSystem && !pattern)
1332 " AND n.nspname <> 'information_schema'\n");
1335 "n.nspname",
"o.opcname", NULL,
1336 "pg_catalog.pg_opclass_is_visible(o.oid)",
1343 " SELECT opf.oid as oid, opf.tableoid as tableoid,\n"
1344 " n.nspname as nspname,\n"
1345 " CAST(opf.opfname AS pg_catalog.text) AS name,\n"
1346 " CAST('%s' AS pg_catalog.text) as object\n"
1347 " FROM pg_catalog.pg_opfamily opf\n"
1348 " JOIN pg_catalog.pg_am am "
1349 "ON opf.opfmethod = am.oid\n"
1350 " JOIN pg_catalog.pg_namespace n "
1351 "ON opf.opfnamespace = n.oid\n",
1354 if (!showSystem && !pattern)
1356 " AND n.nspname <> 'information_schema'\n");
1359 "n.nspname",
"opf.opfname", NULL,
1360 "pg_catalog.pg_opfamily_is_visible(opf.oid)",
1367 " SELECT r.oid as oid, r.tableoid as tableoid,\n"
1368 " n.nspname as nspname,\n"
1369 " CAST(r.rulename AS pg_catalog.text) as name,"
1370 " CAST('%s' AS pg_catalog.text) as object\n"
1371 " FROM pg_catalog.pg_rewrite r\n"
1372 " JOIN pg_catalog.pg_class c ON c.oid = r.ev_class\n"
1373 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"
1374 " WHERE r.rulename != '_RETURN'\n",
1377 if (!showSystem && !pattern)
1379 " AND n.nspname <> 'information_schema'\n");
1382 "n.nspname",
"r.rulename", NULL,
1383 "pg_catalog.pg_table_is_visible(c.oid)",
1390 " SELECT t.oid as oid, t.tableoid as tableoid,\n"
1391 " n.nspname as nspname,\n"
1392 " CAST(t.tgname AS pg_catalog.text) as name,"
1393 " CAST('%s' AS pg_catalog.text) as object\n"
1394 " FROM pg_catalog.pg_trigger t\n"
1395 " JOIN pg_catalog.pg_class c ON c.oid = t.tgrelid\n"
1396 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
1399 if (!showSystem && !pattern)
1401 " AND n.nspname <> 'information_schema'\n");
1404 "n.nspname",
"t.tgname", NULL,
1405 "pg_catalog.pg_table_is_visible(c.oid)",
1411 " JOIN pg_catalog.pg_description d ON (tt.oid = d.objoid AND tt.tableoid = d.classoid AND d.objsubid = 0)\n");
1420 myopt.
title =
_(
"Object descriptions");
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d().
bool permissionsList |
( |
const char * |
pattern, |
|
|
bool |
showSystem |
|
) |
| |
Definition at line 1011 of file describe.c.
1016 static const bool translate_columns[] = {
false,
false,
true,
false,
false,
false};
1024 "SELECT n.nspname as \"%s\",\n"
1025 " c.relname as \"%s\",\n"
1031 " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE)
" THEN '%s'"
1032 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
1053 ",\n pg_catalog.array_to_string(ARRAY(\n"
1054 " SELECT attname || E':\\n ' || pg_catalog.array_to_string(attacl, E'\\n ')\n"
1055 " FROM pg_catalog.pg_attribute a\n"
1056 " WHERE attrelid = c.oid AND NOT attisdropped AND attacl IS NOT NULL\n"
1057 " ), E'\\n') AS \"%s\"",
1062 ",\n pg_catalog.array_to_string(ARRAY(\n"
1064 " || CASE WHEN polcmd != '*' THEN\n"
1065 " E' (' || polcmd::pg_catalog.text || E'):'\n"
1068 " || CASE WHEN polqual IS NOT NULL THEN\n"
1069 " E'\\n (u): ' || pg_catalog.pg_get_expr(polqual, polrelid)\n"
1072 " || CASE WHEN polwithcheck IS NOT NULL THEN\n"
1073 " E'\\n (c): ' || pg_catalog.pg_get_expr(polwithcheck, polrelid)\n"
1076 " || CASE WHEN polroles <> '{0}' THEN\n"
1077 " E'\\n to: ' || pg_catalog.array_to_string(\n"
1080 " FROM pg_catalog.pg_roles\n"
1081 " WHERE oid = ANY (polroles)\n"
1086 " FROM pg_catalog.pg_policy pol\n"
1087 " WHERE polrelid = c.oid), E'\\n')\n"
1093 ",\n pg_catalog.array_to_string(ARRAY(\n"
1095 " || CASE WHEN NOT polpermissive THEN\n"
1096 " E' (RESTRICTIVE)'\n"
1098 " || CASE WHEN polcmd != '*' THEN\n"
1099 " E' (' || polcmd::pg_catalog.text || E'):'\n"
1102 " || CASE WHEN polqual IS NOT NULL THEN\n"
1103 " E'\\n (u): ' || pg_catalog.pg_get_expr(polqual, polrelid)\n"
1106 " || CASE WHEN polwithcheck IS NOT NULL THEN\n"
1107 " E'\\n (c): ' || pg_catalog.pg_get_expr(polwithcheck, polrelid)\n"
1110 " || CASE WHEN polroles <> '{0}' THEN\n"
1111 " E'\\n to: ' || pg_catalog.array_to_string(\n"
1114 " FROM pg_catalog.pg_roles\n"
1115 " WHERE oid = ANY (polroles)\n"
1120 " FROM pg_catalog.pg_policy pol\n"
1121 " WHERE polrelid = c.oid), E'\\n')\n"
1126 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"
1127 "WHERE c.relkind IN ("
1135 if (!showSystem && !pattern)
1137 " AND n.nspname <> 'information_schema'\n");
1140 "n.nspname",
"c.relname", NULL,
1141 "pg_catalog.pg_table_is_visible(c.oid)",
References _, appendPQExpBuffer(), appendPQExpBufferStr(), buf, CppAsString2, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printACLColumn(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, _psqlSettings::sversion, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::translate_columns, printQueryOpt::translate_header, and validateSQLNamePattern().
Referenced by exec_command_d(), and exec_command_z().