|
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 4585 of file describe.c.
4594 "SELECT s.name AS \"%s\", "
4595 "pg_catalog.current_setting(s.name) AS \"%s\"",
4602 ", s.vartype AS \"%s\", s.context AS \"%s\", ",
4616 " LEFT JOIN pg_catalog.pg_parameter_acl p\n"
4617 " ON pg_catalog.lower(s.name) = p.parname\n");
4622 NULL,
"pg_catalog.lower(s.name)", NULL,
4626 " s.setting IS DISTINCT FROM s.boot_val\n");
4636 myopt.
title =
_(
"List of configuration parameters");
4638 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 6374 of file describe.c.
6379 bool has_pubtruncate;
6380 bool has_pubviaroot;
6389 pg_log_error(
"The server (version %s) does not support publications.",
6391 sverbuf,
sizeof(sverbuf)));
6401 "SELECT oid, pubname,\n"
6402 " pg_catalog.pg_get_userbyid(pubowner) AS owner,\n"
6403 " puballtables, pubinsert, pubupdate, pubdelete");
6404 if (has_pubtruncate)
6411 "\nFROM pg_catalog.pg_publication\n");
6414 NULL,
"pubname", NULL,
6436 pg_log_error(
"Did not find any publication named \"%s\".",
6449 const char align =
'l';
6457 if (has_pubtruncate)
6471 if (has_pubtruncate)
6481 if (has_pubtruncate)
6490 "SELECT n.nspname, c.relname");
6494 ", pg_get_expr(pr.prqual, c.oid)");
6496 ", (CASE WHEN pr.prattrs IS NOT NULL THEN\n"
6497 " pg_catalog.array_to_string("
6498 " ARRAY(SELECT attname\n"
6500 " pg_catalog.generate_series(0, pg_catalog.array_upper(pr.prattrs::pg_catalog.int2[], 1)) s,\n"
6501 " pg_catalog.pg_attribute\n"
6502 " WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n"
6509 "\nFROM pg_catalog.pg_class c,\n"
6510 " pg_catalog.pg_namespace n,\n"
6511 " pg_catalog.pg_publication_rel pr\n"
6512 "WHERE c.relnamespace = n.oid\n"
6513 " AND c.oid = pr.prrelid\n"
6514 " AND pr.prpubid = '%s'\n"
6515 "ORDER BY 1,2", pubid);
6523 "SELECT n.nspname\n"
6524 "FROM pg_catalog.pg_namespace n\n"
6525 " JOIN pg_catalog.pg_publication_namespace pn ON n.oid = pn.pnnspid\n"
6526 "WHERE pn.pnpubid = '%s'\n"
6527 "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 3869 of file describe.c.
3877 "SELECT m.rolname AS \"%s\", r.rolname AS \"%s\",\n"
3878 " pg_catalog.concat_ws(', ',\n",
3884 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3885 " CASE WHEN pam.inherit_option THEN 'INHERIT' END,\n"
3886 " CASE WHEN pam.set_option THEN 'SET' END\n");
3889 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3890 " CASE WHEN m.rolinherit THEN 'INHERIT' END,\n"
3895 " g.rolname AS \"%s\"\n",
3900 "FROM pg_catalog.pg_roles m\n"
3901 " JOIN pg_catalog.pg_auth_members pam ON (pam.member = m.oid)\n"
3902 " LEFT JOIN pg_catalog.pg_roles r ON (pam.roleid = r.oid)\n"
3903 " LEFT JOIN pg_catalog.pg_roles g ON (pam.grantor = g.oid)\n");
3905 if (!showSystem && !pattern)
3909 NULL,
"m.rolname", NULL, NULL,
3923 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 3653 of file describe.c.
3663 const char align =
'l';
3671 "SELECT r.rolname, r.rolsuper, r.rolinherit,\n"
3672 " r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,\n"
3673 " r.rolconnlimit, r.rolvaliduntil");
3689 if (!showSystem && !pattern)
3693 NULL,
"r.rolname", NULL, NULL,
3707 attr =
pg_malloc0((nrows + 1) *
sizeof(*attr));
3717 for (
i = 0;
i < nrows;
i++)
3779 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 6560 of file describe.c.
6565 static const bool translate_columns[] = {
false,
false,
false,
false,
6566 false,
false,
false,
false,
false,
false,
false,
false,
false,
false};
6572 pg_log_error(
"The server (version %s) does not support subscriptions.",
6574 sverbuf,
sizeof(sverbuf)));
6581 "SELECT subname AS \"%s\"\n"
6582 ", pg_catalog.pg_get_userbyid(subowner) AS \"%s\"\n"
6583 ", subenabled AS \"%s\"\n"
6584 ", subpublications AS \"%s\"\n",
6596 ", subbinary AS \"%s\"\n",
6601 ", (CASE substream\n"
6602 " WHEN 'f' THEN 'off'\n"
6603 " WHEN 't' THEN 'on'\n"
6604 " WHEN 'p' THEN 'parallel'\n"
6605 " END) AS \"%s\"\n",
6609 ", substream AS \"%s\"\n",
6616 ", subtwophasestate AS \"%s\"\n"
6617 ", subdisableonerr AS \"%s\"\n",
6623 ", suborigin AS \"%s\"\n"
6624 ", subpasswordrequired AS \"%s\"\n"
6625 ", subrunasowner AS \"%s\"\n",
6631 ", subsynccommit AS \"%s\"\n"
6632 ", subconninfo AS \"%s\"\n",
6639 ", subskiplsn AS \"%s\"\n",
6645 "FROM pg_catalog.pg_subscription\n"
6646 "WHERE subdbid = (SELECT oid\n"
6647 " FROM pg_catalog.pg_database\n"
6648 " WHERE datname = pg_catalog.current_database())");
6651 NULL,
"subname", NULL,
6666 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 1441 of file describe.c.
1453 "FROM pg_catalog.pg_class c\n"
1454 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n");
1456 if (!showSystem && !pattern)
1458 " AND n.nspname <> 'information_schema'\n");
1461 "n.nspname",
"c.relname", NULL,
1462 "pg_catalog.pg_table_is_visible(c.oid)",
1481 pg_log_error(
"Did not find any relation named \"%s\".",
1493 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 '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.daticulocale as \"%s\",\n",
946 " NULL as \"%s\",\n",
950 " d.daticurules as \"%s\",\n",
954 " NULL as \"%s\",\n",
960 ",\n CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')\n"
961 " THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname))\n"
962 " ELSE 'No Access'\n"
964 ",\n t.spcname as \"%s\""
965 ",\n pg_catalog.shobj_description(d.oid, 'pg_database') as \"%s\"",
970 "\nFROM pg_catalog.pg_database d\n");
973 " JOIN pg_catalog.pg_tablespace t on d.dattablespace = t.oid\n");
978 NULL,
"d.datname", NULL, NULL,
992 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 4829 of file describe.c.
4834 static const bool translate_columns[] = {
false,
false,
false,
true,
false};
4839 "SELECT pg_catalog.format_type(castsource, NULL) AS \"%s\",\n"
4840 " pg_catalog.format_type(casttarget, NULL) AS \"%s\",\n",
4850 " CASE WHEN c.castmethod = '%c' THEN '(binary coercible)'\n"
4851 " WHEN c.castmethod = '%c' THEN '(with inout)'\n"
4853 " END AS \"%s\",\n",
4854 COERCION_METHOD_BINARY,
4855 COERCION_METHOD_INOUT,
4859 " CASE WHEN c.castcontext = '%c' THEN '%s'\n"
4860 " WHEN c.castcontext = '%c' THEN '%s'\n"
4863 COERCION_CODE_EXPLICIT,
4865 COERCION_CODE_ASSIGNMENT,
4872 ",\n d.description AS \"%s\"",
4880 "\nFROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p\n"
4881 " ON c.castfunc = p.oid\n"
4882 " LEFT JOIN pg_catalog.pg_type ts\n"
4883 " ON c.castsource = ts.oid\n"
4884 " LEFT JOIN pg_catalog.pg_namespace ns\n"
4885 " ON ns.oid = ts.typnamespace\n"
4886 " LEFT JOIN pg_catalog.pg_type tt\n"
4887 " ON c.casttarget = tt.oid\n"
4888 " LEFT JOIN pg_catalog.pg_namespace nt\n"
4889 " ON nt.oid = tt.typnamespace\n");
4893 " LEFT JOIN pg_catalog.pg_description d\n"
4894 " ON d.classoid = c.tableoid AND d.objoid = "
4895 "c.oid AND d.objsubid = 0\n");
4904 "ns.nspname",
"ts.typname",
4905 "pg_catalog.format_type(ts.oid, NULL)",
4906 "pg_catalog.pg_type_is_visible(ts.oid)",
4913 "nt.nspname",
"tt.typname",
4914 "pg_catalog.format_type(tt.oid, NULL)",
4915 "pg_catalog.pg_type_is_visible(tt.oid)",
4926 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 4947 of file describe.c.
4952 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
true,
false};
4958 " n.nspname AS \"%s\",\n"
4959 " c.collname AS \"%s\",\n",
4965 " CASE c.collprovider WHEN 'd' THEN 'default' WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS \"%s\",\n",
4969 " 'libc' AS \"%s\",\n",
4973 " c.collcollate AS \"%s\",\n"
4974 " c.collctype AS \"%s\",\n",
4980 " c.colliculocale AS \"%s\",\n",
4984 " c.collcollate AS \"%s\",\n",
4989 " c.collicurules AS \"%s\",\n",
4993 " NULL AS \"%s\",\n",
4998 " CASE WHEN c.collisdeterministic THEN '%s' ELSE '%s' END AS \"%s\"",
5009 ",\n pg_catalog.obj_description(c.oid, 'pg_collation') AS \"%s\"",
5013 "\nFROM pg_catalog.pg_collation c, pg_catalog.pg_namespace n\n"
5014 "WHERE n.oid = c.collnamespace\n");
5016 if (!showSystem && !pattern)
5018 " AND n.nspname <> 'information_schema'\n");
5026 appendPQExpBufferStr(&
buf,
" AND c.collencoding IN (-1, pg_catalog.pg_char_to_encoding(pg_catalog.getdatabaseencoding()))\n");
5029 "n.nspname",
"c.collname", NULL,
5030 "pg_catalog.pg_collation_is_visible(c.oid)",
5044 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 4505 of file describe.c.
4510 static const bool translate_columns[] =
4511 {
false,
false,
false,
false,
true,
false};
4516 "SELECT n.nspname AS \"%s\",\n"
4517 " c.conname AS \"%s\",\n"
4518 " pg_catalog.pg_encoding_to_char(c.conforencoding) AS \"%s\",\n"
4519 " pg_catalog.pg_encoding_to_char(c.contoencoding) AS \"%s\",\n"
4520 " CASE WHEN c.condefault THEN '%s'\n"
4521 " ELSE '%s' END AS \"%s\"",
4531 ",\n d.description AS \"%s\"",
4535 "\nFROM pg_catalog.pg_conversion c\n"
4536 " JOIN pg_catalog.pg_namespace n "
4537 "ON n.oid = c.connamespace\n");
4541 "LEFT JOIN pg_catalog.pg_description d "
4542 "ON d.classoid = c.tableoid\n"
4543 " AND d.objoid = c.oid "
4544 "AND d.objsubid = 0\n");
4548 if (!showSystem && !pattern)
4550 " AND n.nspname <> 'information_schema'\n");
4553 "n.nspname",
"c.conname", NULL,
4554 "pg_catalog.pg_conversion_is_visible(c.oid)",
4568 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 3800 of file describe.c.
3810 "pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
3811 "FROM pg_catalog.pg_db_role_setting s\n"
3812 "LEFT JOIN pg_catalog.pg_database d ON d.oid = setdatabase\n"
3813 "LEFT JOIN pg_catalog.pg_roles r ON r.oid = setrole\n",
3818 NULL,
"r.rolname", NULL, NULL, &havewhere, 1))
3821 NULL,
"d.datname", NULL, NULL,
3839 if (pattern && pattern2)
3840 pg_log_error(
"Did not find any settings for role \"%s\" and database \"%s\".",
3843 pg_log_error(
"Did not find any settings for role \"%s\".",
3850 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 1171 of file describe.c.
1176 static const bool translate_columns[] = {
false,
false,
true,
false};
1181 "SELECT pg_catalog.pg_get_userbyid(d.defaclrole) AS \"%s\",\n"
1182 " n.nspname AS \"%s\",\n"
1183 " 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"
1195 DEFACLOBJ_NAMESPACE,
1202 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.defaclnamespace\n");
1207 "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 4422 of file describe.c.
4431 "SELECT n.nspname as \"%s\",\n"
4432 " t.typname as \"%s\",\n"
4433 " pg_catalog.format_type(t.typbasetype, t.typtypmod) as \"%s\",\n"
4434 " (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type bt\n"
4435 " WHERE c.oid = t.typcollation AND bt.oid = t.typbasetype AND t.typcollation <> bt.typcollation) as \"%s\",\n"
4436 " CASE WHEN t.typnotnull THEN 'not null' END as \"%s\",\n"
4437 " t.typdefault as \"%s\",\n"
4438 " pg_catalog.array_to_string(ARRAY(\n"
4439 " SELECT pg_catalog.pg_get_constraintdef(r.oid, true) FROM pg_catalog.pg_constraint r WHERE t.oid = r.contypid\n"
4440 " ), ' ') as \"%s\"",
4454 ",\n d.description as \"%s\"",
4459 "\nFROM pg_catalog.pg_type t\n"
4460 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
4464 " LEFT JOIN pg_catalog.pg_description d "
4465 "ON d.classoid = t.tableoid AND d.objoid = t.oid "
4466 "AND d.objsubid = 0\n");
4470 if (!showSystem && !pattern)
4472 " AND n.nspname <> 'information_schema'\n");
4475 "n.nspname",
"t.typname", NULL,
4476 "pg_catalog.pg_type_is_visible(t.oid)",
4490 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 4653 of file describe.c.
4658 static const bool translate_columns[] =
4659 {
false,
false,
false,
true,
false,
false,
false};
4665 pg_log_error(
"The server (version %s) does not support event triggers.",
4667 sverbuf,
sizeof(sverbuf)));
4674 "SELECT evtname as \"%s\", "
4675 "evtevent as \"%s\", "
4676 "pg_catalog.pg_get_userbyid(e.evtowner) as \"%s\",\n"
4677 " case evtenabled when 'O' then '%s'"
4678 " when 'R' then '%s'"
4679 " when 'A' then '%s'"
4680 " when 'D' then '%s' end as \"%s\",\n"
4681 " e.evtfoid::pg_catalog.regproc as \"%s\", "
4682 "pg_catalog.array_to_string(array(select x"
4683 " from pg_catalog.unnest(evttags) as t(x)), ', ') as \"%s\"",
4696 ",\npg_catalog.obj_description(e.oid, 'pg_event_trigger') as \"%s\"",
4699 "\nFROM pg_catalog.pg_event_trigger e ");
4702 NULL,
"evtname", NULL, NULL,
4716 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 4733 of file describe.c.
4743 pg_log_error(
"The server (version %s) does not support extended statistics.",
4745 sverbuf,
sizeof(sverbuf)));
4752 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text AS \"%s\", \n"
4753 "es.stxname AS \"%s\", \n",
4759 "pg_catalog.format('%%s FROM %%s', \n"
4760 " pg_catalog.pg_get_statisticsobjdef_columns(es.oid), \n"
4761 " es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4765 "pg_catalog.format('%%s FROM %%s', \n"
4766 " (SELECT pg_catalog.string_agg(pg_catalog.quote_ident(a.attname),', ') \n"
4767 " FROM pg_catalog.unnest(es.stxkeys) s(attnum) \n"
4768 " JOIN pg_catalog.pg_attribute a \n"
4769 " ON (es.stxrelid = a.attrelid \n"
4770 " AND a.attnum = s.attnum \n"
4771 " AND NOT a.attisdropped)), \n"
4772 "es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4776 ",\nCASE WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
4778 "CASE WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
4789 ",\nCASE WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
4795 " \nFROM pg_catalog.pg_statistic_ext es \n");
4799 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text",
"es.stxname",
4800 NULL,
"pg_catalog.pg_statistics_obj_is_visible(es.oid)",
4814 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 6088 of file describe.c.
6096 "SELECT e.extname, e.oid\n"
6097 "FROM pg_catalog.pg_extension e\n");
6101 NULL,
"e.extname", NULL,
6121 pg_log_error(
"Did not find any extension named \"%s\".",
6132 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 6037 of file describe.c.
6045 "SELECT e.extname AS \"%s\", "
6046 "e.extversion AS \"%s\", n.nspname AS \"%s\", c.description AS \"%s\"\n"
6047 "FROM pg_catalog.pg_extension e "
6048 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace "
6049 "LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid "
6050 "AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n",
6058 NULL,
"e.extname", NULL,
6073 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 5763 of file describe.c.
5771 "SELECT fdw.fdwname AS \"%s\",\n"
5772 " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n"
5773 " fdw.fdwhandler::pg_catalog.regproc AS \"%s\",\n"
5774 " fdw.fdwvalidator::pg_catalog.regproc AS \"%s\"",
5785 ",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
5786 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5787 " pg_catalog.quote_ident(option_name) || ' ' || "
5788 " pg_catalog.quote_literal(option_value) FROM "
5789 " pg_catalog.pg_options_to_table(fdwoptions)), ', ') || ')' "
5791 ",\n d.description AS \"%s\" ",
5800 "LEFT JOIN pg_catalog.pg_description d\n"
5801 " ON d.classoid = fdw.tableoid "
5802 "AND d.objoid = fdw.oid AND d.objsubid = 0\n");
5805 NULL,
"fdwname", NULL, NULL,
5819 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 5834 of file describe.c.
5842 "SELECT s.srvname AS \"%s\",\n"
5843 " pg_catalog.pg_get_userbyid(s.srvowner) AS \"%s\",\n"
5844 " f.fdwname AS \"%s\"",
5855 " s.srvtype AS \"%s\",\n"
5856 " s.srvversion AS \"%s\",\n"
5857 " CASE WHEN srvoptions IS NULL THEN '' ELSE "
5858 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5859 " pg_catalog.quote_ident(option_name) || ' ' || "
5860 " pg_catalog.quote_literal(option_value) FROM "
5861 " pg_catalog.pg_options_to_table(srvoptions)), ', ') || ')' "
5863 " d.description AS \"%s\"",
5871 "\nFROM pg_catalog.pg_foreign_server s\n"
5872 " JOIN pg_catalog.pg_foreign_data_wrapper f ON f.oid=s.srvfdw\n");
5876 "LEFT JOIN pg_catalog.pg_description d\n "
5877 "ON d.classoid = s.tableoid AND d.objoid = s.oid "
5878 "AND d.objsubid = 0\n");
5881 NULL,
"s.srvname", NULL, NULL,
5895 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 5965 of file describe.c.
5973 "SELECT n.nspname AS \"%s\",\n"
5974 " c.relname AS \"%s\",\n"
5975 " s.srvname AS \"%s\"",
5982 ",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
5983 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5984 " pg_catalog.quote_ident(option_name) || ' ' || "
5985 " pg_catalog.quote_literal(option_value) FROM "
5986 " pg_catalog.pg_options_to_table(ftoptions)), ', ') || ')' "
5988 " d.description AS \"%s\"",
5993 "\nFROM pg_catalog.pg_foreign_table ft\n"
5994 " INNER JOIN pg_catalog.pg_class c"
5995 " ON c.oid = ft.ftrelid\n"
5996 " INNER JOIN pg_catalog.pg_namespace n"
5997 " ON n.oid = c.relnamespace\n"
5998 " INNER JOIN pg_catalog.pg_foreign_server s"
5999 " ON s.oid = ft.ftserver\n");
6002 " LEFT JOIN pg_catalog.pg_description d\n"
6003 " ON d.classoid = c.tableoid AND "
6004 "d.objoid = c.oid AND d.objsubid = 0\n");
6007 "n.nspname",
"c.relname", NULL,
6008 "pg_catalog.pg_table_is_visible(c.oid)",
6022 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 4346 of file describe.c.
4355 "SELECT l.lanname AS \"%s\",\n"
4356 " pg_catalog.pg_get_userbyid(l.lanowner) as \"%s\",\n"
4357 " l.lanpltrusted AS \"%s\"",
4365 ",\n NOT l.lanispl AS \"%s\",\n"
4366 " l.lanplcallfoid::pg_catalog.regprocedure AS \"%s\",\n"
4367 " l.lanvalidator::pg_catalog.regprocedure AS \"%s\",\n "
4368 "l.laninline::pg_catalog.regprocedure AS \"%s\",\n ",
4377 ",\n d.description AS \"%s\""
4378 "\nFROM pg_catalog.pg_language l\n"
4379 "LEFT JOIN pg_catalog.pg_description d\n"
4380 " ON d.classoid = l.tableoid AND d.objoid = l.oid\n"
4381 " AND d.objsubid = 0\n",
4387 NULL,
"l.lanname", NULL, NULL,
4395 if (!showSystem && !pattern)
4406 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 7083 of file describe.c.
7092 "SELECT oid as \"%s\",\n"
7093 " pg_catalog.pg_get_userbyid(lomowner) as \"%s\",\n ",
7104 "pg_catalog.obj_description(oid, 'pg_largeobject') as \"%s\"\n"
7105 "FROM pg_catalog.pg_largeobject_metadata\n"
7114 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 6706 of file describe.c.
6712 bool have_where =
false;
6713 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false};
6719 " am.amname AS \"%s\",\n"
6720 " pg_catalog.format_type(c.opcintype, NULL) AS \"%s\",\n"
6722 " WHEN c.opckeytype <> 0 AND c.opckeytype <> c.opcintype\n"
6723 " THEN pg_catalog.format_type(c.opckeytype, NULL)\n"
6727 " WHEN pg_catalog.pg_opclass_is_visible(c.oid)\n"
6728 " THEN pg_catalog.format('%%I', c.opcname)\n"
6729 " ELSE pg_catalog.format('%%I.%%I', n.nspname, c.opcname)\n"
6731 " (CASE WHEN c.opcdefault\n"
6745 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6746 " THEN pg_catalog.format('%%I', of.opfname)\n"
6747 " ELSE pg_catalog.format('%%I.%%I', ofn.nspname, of.opfname)\n"
6749 " pg_catalog.pg_get_userbyid(c.opcowner) AS \"%s\"\n",
6753 "\nFROM pg_catalog.pg_opclass c\n"
6754 " LEFT JOIN pg_catalog.pg_am am on am.oid = c.opcmethod\n"
6755 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.opcnamespace\n"
6756 " LEFT JOIN pg_catalog.pg_type t ON t.oid = c.opcintype\n"
6757 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n");
6760 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = c.opcfamily\n"
6761 " LEFT JOIN pg_catalog.pg_namespace ofn ON ofn.oid = of.opfnamespace\n");
6763 if (access_method_pattern)
6765 false,
false, NULL,
"am.amname", NULL, NULL,
6772 "tn.nspname",
"t.typname",
6773 "pg_catalog.format_type(t.oid, NULL)",
6774 "pg_catalog.pg_type_is_visible(t.oid)",
6785 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 6807 of file describe.c.
6813 bool have_where =
false;
6814 static const bool translate_columns[] = {
false,
false,
false,
false};
6820 " am.amname AS \"%s\",\n"
6822 " WHEN pg_catalog.pg_opfamily_is_visible(f.oid)\n"
6823 " THEN pg_catalog.format('%%I', f.opfname)\n"
6824 " ELSE pg_catalog.format('%%I.%%I', n.nspname, f.opfname)\n"
6827 " pg_catalog.string_agg(pg_catalog.format_type(oc.opcintype, NULL), ', ')\n"
6828 " FROM pg_catalog.pg_opclass oc\n"
6829 " WHERE oc.opcfamily = f.oid) \"%s\"",
6835 ",\n pg_catalog.pg_get_userbyid(f.opfowner) AS \"%s\"\n",
6838 "\nFROM pg_catalog.pg_opfamily f\n"
6839 " LEFT JOIN pg_catalog.pg_am am on am.oid = f.opfmethod\n"
6840 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = f.opfnamespace\n");
6842 if (access_method_pattern)
6844 false,
false, NULL,
"am.amname", NULL, NULL,
6852 " FROM pg_catalog.pg_type t\n"
6853 " JOIN pg_catalog.pg_opclass oc ON oc.opcintype = t.oid\n"
6854 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n"
6855 " WHERE oc.opcfamily = f.oid\n",
6856 have_where ?
"AND" :
"WHERE");
6859 "tn.nspname",
"t.typname",
6860 "pg_catalog.format_type(t.oid, NULL)",
6861 "pg_catalog.pg_type_is_visible(t.oid)",
6873 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 6994 of file describe.c.
7000 bool have_where =
false;
7001 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
7007 " am.amname AS \"%s\",\n"
7009 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
7010 " THEN pg_catalog.format('%%I', of.opfname)\n"
7011 " ELSE pg_catalog.format('%%I.%%I', ns.nspname, of.opfname)\n"
7013 " pg_catalog.format_type(ap.amproclefttype, NULL) AS \"%s\",\n"
7014 " pg_catalog.format_type(ap.amprocrighttype, NULL) AS \"%s\",\n"
7015 " ap.amprocnum AS \"%s\"\n",
7024 ", p.proname AS \"%s\"\n",
7028 ", ap.amproc::pg_catalog.regprocedure AS \"%s\"\n",
7032 "FROM pg_catalog.pg_amproc ap\n"
7033 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = ap.amprocfamily\n"
7034 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod\n"
7035 " LEFT JOIN pg_catalog.pg_namespace ns ON of.opfnamespace = ns.oid\n"
7036 " LEFT JOIN pg_catalog.pg_proc p ON ap.amproc = p.oid\n");
7038 if (access_method_pattern)
7041 false,
false, NULL,
"am.amname",
7049 "ns.nspname",
"of.opfname", NULL, NULL,
7055 " ap.amproclefttype = ap.amprocrighttype DESC,\n"
7063 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 6896 of file describe.c.
6902 bool have_where =
false;
6904 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
6910 " am.amname AS \"%s\",\n"
6912 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6913 " THEN pg_catalog.format('%%I', of.opfname)\n"
6914 " ELSE pg_catalog.format('%%I.%%I', nsf.nspname, of.opfname)\n"
6916 " o.amopopr::pg_catalog.regoperator AS \"%s\"\n,"
6917 " o.amopstrategy AS \"%s\",\n"
6918 " CASE o.amoppurpose\n"
6919 " WHEN 'o' THEN '%s'\n"
6920 " WHEN 's' THEN '%s'\n"
6932 ", ofs.opfname AS \"%s\"\n",
6935 "FROM pg_catalog.pg_amop o\n"
6936 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = o.amopfamily\n"
6937 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod AND am.oid = o.amopmethod\n"
6938 " LEFT JOIN pg_catalog.pg_namespace nsf ON of.opfnamespace = nsf.oid\n");
6941 " LEFT JOIN pg_catalog.pg_opfamily ofs ON ofs.oid = o.amopsortfamily\n");
6943 if (access_method_pattern)
6946 false,
false, NULL,
"am.amname",
6955 "nsf.nspname",
"of.opfname", NULL, NULL,
6961 " o.amoplefttype = o.amoprighttype DESC,\n"
6962 " pg_catalog.format_type(o.amoplefttype, NULL),\n"
6963 " pg_catalog.format_type(o.amoprighttype, NULL),\n"
6964 " o.amopstrategy;");
6971 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 4146 of file describe.c.
4148 bool showTables = strchr(reltypes,
't') != NULL;
4149 bool showIndexes = strchr(reltypes,
'i') != NULL;
4150 bool showNested = strchr(reltypes,
'n') != NULL;
4155 bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false,
false};
4156 const char *tabletitle;
4157 bool mixed_output =
false;
4166 pg_log_error(
"The server (version %s) does not support declarative table partitioning.",
4168 sverbuf,
sizeof(sverbuf)));
4173 if (!showTables && !showIndexes)
4174 showTables = showIndexes =
true;
4176 if (showIndexes && !showTables)
4177 tabletitle =
_(
"List of partitioned indexes");
4178 else if (showTables && !showIndexes)
4179 tabletitle =
_(
"List of partitioned tables");
4183 tabletitle =
_(
"List of partitioned relations");
4184 mixed_output =
true;
4190 "SELECT n.nspname as \"%s\",\n"
4191 " c.relname as \"%s\",\n"
4192 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
4200 ",\n CASE c.relkind"
4201 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
4202 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
4208 translate_columns[3] =
true;
4211 if (showNested || pattern)
4213 ",\n inh.inhparent::pg_catalog.regclass as \"%s\"",
4218 ",\n c2.oid::pg_catalog.regclass as \"%s\"",
4226 ",\n s.dps as \"%s\"",
4229 ",\n s.tps as \"%s\"",
4235 ",\n s.tps as \"%s\"",
4239 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4244 "\nFROM pg_catalog.pg_class c"
4245 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4249 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4250 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4252 if (showNested || pattern)
4254 "\n LEFT JOIN pg_catalog.pg_inherits inh ON c.oid = inh.inhrelid");
4261 ",\n LATERAL (WITH RECURSIVE d\n"
4262 " AS (SELECT inhrelid AS oid, 1 AS level\n"
4263 " FROM pg_catalog.pg_inherits\n"
4264 " WHERE inhparent = c.oid\n"
4266 " SELECT inhrelid, level + 1\n"
4267 " FROM pg_catalog.pg_inherits i\n"
4268 " JOIN d ON i.inhparent = d.oid)\n"
4269 " SELECT pg_catalog.pg_size_pretty(sum(pg_catalog.pg_table_size("
4270 "d.oid))) AS tps,\n"
4271 " pg_catalog.pg_size_pretty(sum("
4272 "\n CASE WHEN d.level = 1"
4273 " THEN pg_catalog.pg_table_size(d.oid) ELSE 0 END)) AS dps\n"
4280 ",\n LATERAL (SELECT pg_catalog.pg_size_pretty(sum("
4281 "\n CASE WHEN ppt.isleaf AND ppt.level = 1"
4282 "\n THEN pg_catalog.pg_table_size(ppt.relid)"
4283 " ELSE 0 END)) AS dps"
4284 ",\n pg_catalog.pg_size_pretty(sum("
4285 "pg_catalog.pg_table_size(ppt.relid))) AS tps"
4286 "\n FROM pg_catalog.pg_partition_tree(c.oid) ppt) s");
4299 " AND NOT c.relispartition\n" :
"");
4303 " AND n.nspname !~ '^pg_toast'\n"
4304 " AND n.nspname <> 'information_schema'\n");
4307 "n.nspname",
"c.relname", NULL,
4308 "pg_catalog.pg_table_is_visible(c.oid)",
4316 mixed_output ?
"\"Type\" DESC, " :
"",
4317 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 6252 of file describe.c.
6257 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false};
6263 pg_log_error(
"The server (version %s) does not support publications.",
6265 sverbuf,
sizeof(sverbuf)));
6272 "SELECT pubname AS \"%s\",\n"
6273 " pg_catalog.pg_get_userbyid(pubowner) AS \"%s\",\n"
6274 " puballtables AS \"%s\",\n"
6275 " pubinsert AS \"%s\",\n"
6276 " pubupdate AS \"%s\",\n"
6277 " pubdelete AS \"%s\"",
6286 ",\n pubtruncate AS \"%s\"",
6290 ",\n pubviaroot AS \"%s\"",
6294 "\nFROM pg_catalog.pg_publication\n");
6297 NULL,
"pubname", NULL,
6312 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 5061 of file describe.c.
5066 int pub_schema_tuples = 0;
5067 char **footers = NULL;
5071 "SELECT n.nspname AS \"%s\",\n"
5072 " pg_catalog.pg_get_userbyid(n.nspowner) AS \"%s\"",
5081 ",\n pg_catalog.obj_description(n.oid, 'pg_namespace') AS \"%s\"",
5086 "\nFROM pg_catalog.pg_namespace n\n");
5088 if (!showSystem && !pattern)
5090 "WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'\n");
5093 !showSystem && !pattern,
false,
5094 NULL,
"n.nspname", NULL,
5105 myopt.
title =
_(
"List of schemas");
5115 "FROM pg_catalog.pg_publication p\n"
5116 " JOIN pg_catalog.pg_publication_namespace pn ON p.oid = pn.pnpubid\n"
5117 " JOIN pg_catalog.pg_namespace n ON n.oid = pn.pnnspid \n"
5118 "WHERE n.nspname = '%s'\n"
5127 if (pub_schema_tuples > 0)
5134 footers = (
char **)
pg_malloc((1 + pub_schema_tuples + 1) *
sizeof(
char *));
5138 for (
i = 0;
i < pub_schema_tuples;
i++)
5146 footers[
i + 1] = NULL;
5161 char **footer = NULL;
5163 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 3948 of file describe.c.
3950 bool showTables = strchr(tabtypes,
't') != NULL;
3951 bool showIndexes = strchr(tabtypes,
'i') != NULL;
3952 bool showViews = strchr(tabtypes,
'v') != NULL;
3953 bool showMatViews = strchr(tabtypes,
'm') != NULL;
3954 bool showSeq = strchr(tabtypes,
's') != NULL;
3955 bool showForeign = strchr(tabtypes,
'E') != NULL;
3961 bool translate_columns[] = {
false,
false,
true,
false,
false,
false,
false,
false,
false};
3964 if (!(showTables || showIndexes || showViews || showMatViews || showSeq || showForeign))
3965 showTables = showViews = showMatViews = showSeq = showForeign =
true;
3970 "SELECT n.nspname as \"%s\",\n"
3971 " c.relname as \"%s\",\n"
3979 " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE)
" THEN '%s'"
3980 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
3981 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
3983 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
4002 ",\n c2.relname as \"%s\"",
4013 ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"",
4018 translate_columns[cols_so_far] =
true;
4030 (showTables || showMatViews || showIndexes))
4032 ",\n am.amname as \"%s\"",
4036 ",\n pg_catalog.pg_size_pretty(pg_catalog.pg_table_size(c.oid)) as \"%s\""
4037 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4043 "\nFROM pg_catalog.pg_class c"
4044 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4047 (showTables || showMatViews || showIndexes))
4049 "\n LEFT JOIN pg_catalog.pg_am am ON am.oid = c.relam");
4053 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4054 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4062 if (showSystem || pattern)
4074 if (showSystem || pattern)
4082 if (!showSystem && !pattern)
4084 " AND n.nspname !~ '^pg_toast'\n"
4085 " AND n.nspname <> 'information_schema'\n");
4088 "n.nspname",
"c.relname", NULL,
4089 "pg_catalog.pg_table_is_visible(c.oid)",
4111 pg_log_error(
"Did not find any relation named \"%s\".",
4118 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 5559 of file describe.c.
5572 " n.nspname as \"%s\",\n"
5573 " c.cfgname as \"%s\",\n"
5574 " pg_catalog.obj_description(c.oid, 'pg_ts_config') as \"%s\"\n"
5575 "FROM pg_catalog.pg_ts_config c\n"
5576 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.cfgnamespace\n",
5583 "n.nspname",
"c.cfgname", NULL,
5584 "pg_catalog.pg_ts_config_is_visible(c.oid)",
5598 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 5429 of file describe.c.
5439 " n.nspname as \"%s\",\n"
5440 " d.dictname as \"%s\",\n",
5447 " ( SELECT COALESCE(nt.nspname, '(null)')::pg_catalog.text || '.' || t.tmplname FROM\n"
5448 " pg_catalog.pg_ts_template t\n"
5449 " LEFT JOIN pg_catalog.pg_namespace nt ON nt.oid = t.tmplnamespace\n"
5450 " WHERE d.dicttemplate = t.oid ) AS \"%s\",\n"
5451 " d.dictinitoption as \"%s\",\n",
5457 " pg_catalog.obj_description(d.oid, 'pg_ts_dict') as \"%s\"\n",
5461 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.dictnamespace\n");
5464 "n.nspname",
"d.dictname", NULL,
5465 "pg_catalog.pg_ts_dict_is_visible(d.oid)",
5479 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 5182 of file describe.c.
5195 " n.nspname as \"%s\",\n"
5196 " p.prsname as \"%s\",\n"
5197 " pg_catalog.obj_description(p.oid, 'pg_ts_parser') as \"%s\"\n"
5198 "FROM pg_catalog.pg_ts_parser p\n"
5199 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.prsnamespace\n",
5206 "n.nspname",
"p.prsname", NULL,
5207 "pg_catalog.pg_ts_parser_is_visible(p.oid)",
5221 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 5494 of file describe.c.
5505 " n.nspname AS \"%s\",\n"
5506 " t.tmplname AS \"%s\",\n"
5507 " t.tmplinit::pg_catalog.regproc AS \"%s\",\n"
5508 " t.tmpllexize::pg_catalog.regproc AS \"%s\",\n"
5509 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5518 " n.nspname AS \"%s\",\n"
5519 " t.tmplname AS \"%s\",\n"
5520 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5526 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.tmplnamespace\n");
5529 "n.nspname",
"t.tmplname", NULL,
5530 "pg_catalog.pg_ts_template_is_visible(t.oid)",
5544 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 5910 of file describe.c.
5918 "SELECT um.srvname AS \"%s\",\n"
5919 " um.usename AS \"%s\"",
5925 ",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
5926 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5927 " pg_catalog.quote_ident(option_name) || ' ' || "
5928 " pg_catalog.quote_literal(option_value) FROM "
5929 " pg_catalog.pg_options_to_table(umoptions)), ', ') || ')' "
5936 NULL,
"um.srvname",
"um.usename", NULL,
5950 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 1248 of file describe.c.
1253 static const bool translate_columns[] = {
false,
false,
true,
false};
1258 "SELECT DISTINCT tt.nspname AS \"%s\", tt.name AS \"%s\", tt.object AS \"%s\", d.description AS \"%s\"\n"
1267 " SELECT pgc.oid as oid, pgc.tableoid AS tableoid,\n"
1268 " n.nspname as nspname,\n"
1269 " CAST(pgc.conname AS pg_catalog.text) as name,"
1270 " CAST('%s' AS pg_catalog.text) as object\n"
1271 " FROM pg_catalog.pg_constraint pgc\n"
1272 " JOIN pg_catalog.pg_class c "
1273 "ON c.oid = pgc.conrelid\n"
1274 " LEFT JOIN pg_catalog.pg_namespace n "
1275 " ON n.oid = c.relnamespace\n",
1278 if (!showSystem && !pattern)
1280 " AND n.nspname <> 'information_schema'\n");
1283 false,
"n.nspname",
"pgc.conname", NULL,
1284 "pg_catalog.pg_table_is_visible(c.oid)",
1291 " SELECT pgc.oid as oid, pgc.tableoid AS tableoid,\n"
1292 " n.nspname as nspname,\n"
1293 " CAST(pgc.conname AS pg_catalog.text) as name,"
1294 " CAST('%s' AS pg_catalog.text) as object\n"
1295 " FROM pg_catalog.pg_constraint pgc\n"
1296 " JOIN pg_catalog.pg_type t "
1297 "ON t.oid = pgc.contypid\n"
1298 " LEFT JOIN pg_catalog.pg_namespace n "
1299 " ON n.oid = t.typnamespace\n",
1302 if (!showSystem && !pattern)
1304 " AND n.nspname <> 'information_schema'\n");
1307 false,
"n.nspname",
"pgc.conname", NULL,
1308 "pg_catalog.pg_type_is_visible(t.oid)",
1315 " SELECT o.oid as oid, o.tableoid as tableoid,\n"
1316 " n.nspname as nspname,\n"
1317 " CAST(o.opcname AS pg_catalog.text) as name,\n"
1318 " CAST('%s' AS pg_catalog.text) as object\n"
1319 " FROM pg_catalog.pg_opclass o\n"
1320 " JOIN pg_catalog.pg_am am ON "
1321 "o.opcmethod = am.oid\n"
1322 " JOIN pg_catalog.pg_namespace n ON "
1323 "n.oid = o.opcnamespace\n",
1326 if (!showSystem && !pattern)
1328 " AND n.nspname <> 'information_schema'\n");
1331 "n.nspname",
"o.opcname", NULL,
1332 "pg_catalog.pg_opclass_is_visible(o.oid)",
1339 " SELECT opf.oid as oid, opf.tableoid as tableoid,\n"
1340 " n.nspname as nspname,\n"
1341 " CAST(opf.opfname AS pg_catalog.text) AS name,\n"
1342 " CAST('%s' AS pg_catalog.text) as object\n"
1343 " FROM pg_catalog.pg_opfamily opf\n"
1344 " JOIN pg_catalog.pg_am am "
1345 "ON opf.opfmethod = am.oid\n"
1346 " JOIN pg_catalog.pg_namespace n "
1347 "ON opf.opfnamespace = n.oid\n",
1350 if (!showSystem && !pattern)
1352 " AND n.nspname <> 'information_schema'\n");
1355 "n.nspname",
"opf.opfname", NULL,
1356 "pg_catalog.pg_opfamily_is_visible(opf.oid)",
1363 " SELECT r.oid as oid, r.tableoid as tableoid,\n"
1364 " n.nspname as nspname,\n"
1365 " CAST(r.rulename AS pg_catalog.text) as name,"
1366 " CAST('%s' AS pg_catalog.text) as object\n"
1367 " FROM pg_catalog.pg_rewrite r\n"
1368 " JOIN pg_catalog.pg_class c ON c.oid = r.ev_class\n"
1369 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"
1370 " WHERE r.rulename != '_RETURN'\n",
1373 if (!showSystem && !pattern)
1375 " AND n.nspname <> 'information_schema'\n");
1378 "n.nspname",
"r.rulename", NULL,
1379 "pg_catalog.pg_table_is_visible(c.oid)",
1386 " SELECT t.oid as oid, t.tableoid as tableoid,\n"
1387 " n.nspname as nspname,\n"
1388 " CAST(t.tgname AS pg_catalog.text) as name,"
1389 " CAST('%s' AS pg_catalog.text) as object\n"
1390 " FROM pg_catalog.pg_trigger t\n"
1391 " JOIN pg_catalog.pg_class c ON c.oid = t.tgrelid\n"
1392 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
1395 if (!showSystem && !pattern)
1397 " AND n.nspname <> 'information_schema'\n");
1400 "n.nspname",
"t.tgname", NULL,
1401 "pg_catalog.pg_table_is_visible(c.oid)",
1407 " JOIN pg_catalog.pg_description d ON (tt.oid = d.objoid AND tt.tableoid = d.classoid AND d.objsubid = 0)\n");
1416 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 1007 of file describe.c.
1012 static const bool translate_columns[] = {
false,
false,
true,
false,
false,
false};
1020 "SELECT n.nspname as \"%s\",\n"
1021 " c.relname as \"%s\",\n"
1027 " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE)
" THEN '%s'"
1028 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
1049 ",\n pg_catalog.array_to_string(ARRAY(\n"
1050 " SELECT attname || E':\\n ' || pg_catalog.array_to_string(attacl, E'\\n ')\n"
1051 " FROM pg_catalog.pg_attribute a\n"
1052 " WHERE attrelid = c.oid AND NOT attisdropped AND attacl IS NOT NULL\n"
1053 " ), E'\\n') AS \"%s\"",
1058 ",\n pg_catalog.array_to_string(ARRAY(\n"
1060 " || CASE WHEN polcmd != '*' THEN\n"
1061 " E' (' || polcmd::pg_catalog.text || E'):'\n"
1064 " || CASE WHEN polqual IS NOT NULL THEN\n"
1065 " E'\\n (u): ' || pg_catalog.pg_get_expr(polqual, polrelid)\n"
1068 " || CASE WHEN polwithcheck IS NOT NULL THEN\n"
1069 " E'\\n (c): ' || pg_catalog.pg_get_expr(polwithcheck, polrelid)\n"
1072 " || CASE WHEN polroles <> '{0}' THEN\n"
1073 " E'\\n to: ' || pg_catalog.array_to_string(\n"
1076 " FROM pg_catalog.pg_roles\n"
1077 " WHERE oid = ANY (polroles)\n"
1082 " FROM pg_catalog.pg_policy pol\n"
1083 " WHERE polrelid = c.oid), E'\\n')\n"
1089 ",\n pg_catalog.array_to_string(ARRAY(\n"
1091 " || CASE WHEN NOT polpermissive THEN\n"
1092 " E' (RESTRICTIVE)'\n"
1094 " || CASE WHEN polcmd != '*' THEN\n"
1095 " E' (' || polcmd::pg_catalog.text || E'):'\n"
1098 " || CASE WHEN polqual IS NOT NULL THEN\n"
1099 " E'\\n (u): ' || pg_catalog.pg_get_expr(polqual, polrelid)\n"
1102 " || CASE WHEN polwithcheck IS NOT NULL THEN\n"
1103 " E'\\n (c): ' || pg_catalog.pg_get_expr(polwithcheck, polrelid)\n"
1106 " || CASE WHEN polroles <> '{0}' THEN\n"
1107 " E'\\n to: ' || pg_catalog.array_to_string(\n"
1110 " FROM pg_catalog.pg_roles\n"
1111 " WHERE oid = ANY (polroles)\n"
1116 " FROM pg_catalog.pg_policy pol\n"
1117 " WHERE polrelid = c.oid), E'\\n')\n"
1122 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"
1123 "WHERE c.relkind IN ("
1131 if (!showSystem && !pattern)
1133 " AND n.nspname <> 'information_schema'\n");
1136 "n.nspname",
"c.relname", NULL,
1137 "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().