|
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 4564 of file describe.c.
4573 "SELECT s.name AS \"%s\", "
4574 "pg_catalog.current_setting(s.name) AS \"%s\"",
4581 ", s.vartype AS \"%s\", s.context AS \"%s\", ",
4595 " LEFT JOIN pg_catalog.pg_parameter_acl p\n"
4596 " ON pg_catalog.lower(s.name) = p.parname\n");
4601 NULL,
"pg_catalog.lower(s.name)", NULL,
4605 " s.setting IS DISTINCT FROM s.boot_val\n");
4615 myopt.
title =
_(
"List of configuration parameters");
4617 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 6357 of file describe.c.
6362 bool has_pubtruncate;
6363 bool has_pubviaroot;
6372 pg_log_error(
"The server (version %s) does not support publications.",
6374 sverbuf,
sizeof(sverbuf)));
6384 "SELECT oid, pubname,\n"
6385 " pg_catalog.pg_get_userbyid(pubowner) AS owner,\n"
6386 " puballtables, pubinsert, pubupdate, pubdelete");
6387 if (has_pubtruncate)
6394 "\nFROM pg_catalog.pg_publication\n");
6397 NULL,
"pubname", NULL,
6419 pg_log_error(
"Did not find any publication named \"%s\".",
6432 const char align =
'l';
6440 if (has_pubtruncate)
6454 if (has_pubtruncate)
6464 if (has_pubtruncate)
6473 "SELECT n.nspname, c.relname");
6477 ", pg_get_expr(pr.prqual, c.oid)");
6479 ", (CASE WHEN pr.prattrs IS NOT NULL THEN\n"
6480 " pg_catalog.array_to_string("
6481 " ARRAY(SELECT attname\n"
6483 " pg_catalog.generate_series(0, pg_catalog.array_upper(pr.prattrs::pg_catalog.int2[], 1)) s,\n"
6484 " pg_catalog.pg_attribute\n"
6485 " WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n"
6492 "\nFROM pg_catalog.pg_class c,\n"
6493 " pg_catalog.pg_namespace n,\n"
6494 " pg_catalog.pg_publication_rel pr\n"
6495 "WHERE c.relnamespace = n.oid\n"
6496 " AND c.oid = pr.prrelid\n"
6497 " AND pr.prpubid = '%s'\n"
6498 "ORDER BY 1,2", pubid);
6506 "SELECT n.nspname\n"
6507 "FROM pg_catalog.pg_namespace n\n"
6508 " JOIN pg_catalog.pg_publication_namespace pn ON n.oid = pn.pnnspid\n"
6509 "WHERE pn.pnpubid = '%s'\n"
6510 "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 3838 of file describe.c.
3846 "SELECT m.rolname AS \"%s\", r.rolname AS \"%s\",\n"
3847 " pg_catalog.concat_ws(', ',\n",
3853 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3854 " CASE WHEN pam.inherit_option THEN 'INHERIT' END,\n"
3855 " CASE WHEN pam.set_option THEN 'SET' END\n");
3858 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3859 " CASE WHEN m.rolinherit THEN 'INHERIT' END,\n"
3864 " g.rolname AS \"%s\"\n",
3869 "FROM pg_catalog.pg_roles m\n"
3870 " JOIN pg_catalog.pg_auth_members pam ON (pam.member = m.oid)\n"
3871 " LEFT JOIN pg_catalog.pg_roles r ON (pam.roleid = r.oid)\n"
3872 " LEFT JOIN pg_catalog.pg_roles g ON (pam.grantor = g.oid)\n");
3874 if (!showSystem && !pattern)
3878 NULL,
"m.rolname", NULL, NULL,
3892 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 3622 of file describe.c.
3632 const char align =
'l';
3640 "SELECT r.rolname, r.rolsuper, r.rolinherit,\n"
3641 " r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,\n"
3642 " r.rolconnlimit, r.rolvaliduntil");
3658 if (!showSystem && !pattern)
3662 NULL,
"r.rolname", NULL, NULL,
3676 attr =
pg_malloc0((nrows + 1) *
sizeof(*attr));
3686 for (
i = 0;
i < nrows;
i++)
3748 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 6543 of file describe.c.
6548 static const bool translate_columns[] = {
false,
false,
false,
false,
6549 false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
6556 pg_log_error(
"The server (version %s) does not support subscriptions.",
6558 sverbuf,
sizeof(sverbuf)));
6565 "SELECT subname AS \"%s\"\n"
6566 ", pg_catalog.pg_get_userbyid(subowner) AS \"%s\"\n"
6567 ", subenabled AS \"%s\"\n"
6568 ", subpublications AS \"%s\"\n",
6580 ", subbinary AS \"%s\"\n",
6585 ", (CASE substream\n"
6586 " WHEN 'f' THEN 'off'\n"
6587 " WHEN 't' THEN 'on'\n"
6588 " WHEN 'p' THEN 'parallel'\n"
6589 " END) AS \"%s\"\n",
6593 ", substream AS \"%s\"\n",
6600 ", subtwophasestate AS \"%s\"\n"
6601 ", subdisableonerr AS \"%s\"\n",
6607 ", suborigin AS \"%s\"\n"
6608 ", subpasswordrequired AS \"%s\"\n"
6609 ", subrunasowner AS \"%s\"\n",
6616 ", subfailover AS \"%s\"\n",
6620 ", subsynccommit AS \"%s\"\n"
6621 ", subconninfo AS \"%s\"\n",
6628 ", subskiplsn AS \"%s\"\n",
6634 "FROM pg_catalog.pg_subscription\n"
6635 "WHERE subdbid = (SELECT oid\n"
6636 " FROM pg_catalog.pg_database\n"
6637 " WHERE datname = pg_catalog.current_database())");
6640 NULL,
"subname", NULL,
6655 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 4808 of file describe.c.
4813 static const bool translate_columns[] = {
false,
false,
false,
true,
false};
4818 "SELECT pg_catalog.format_type(castsource, NULL) AS \"%s\",\n"
4819 " pg_catalog.format_type(casttarget, NULL) AS \"%s\",\n",
4829 " CASE WHEN c.castmethod = '%c' THEN '(binary coercible)'\n"
4830 " WHEN c.castmethod = '%c' THEN '(with inout)'\n"
4832 " END AS \"%s\",\n",
4833 COERCION_METHOD_BINARY,
4834 COERCION_METHOD_INOUT,
4838 " CASE WHEN c.castcontext = '%c' THEN '%s'\n"
4839 " WHEN c.castcontext = '%c' THEN '%s'\n"
4842 COERCION_CODE_EXPLICIT,
4844 COERCION_CODE_ASSIGNMENT,
4851 ",\n d.description AS \"%s\"",
4859 "\nFROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p\n"
4860 " ON c.castfunc = p.oid\n"
4861 " LEFT JOIN pg_catalog.pg_type ts\n"
4862 " ON c.castsource = ts.oid\n"
4863 " LEFT JOIN pg_catalog.pg_namespace ns\n"
4864 " ON ns.oid = ts.typnamespace\n"
4865 " LEFT JOIN pg_catalog.pg_type tt\n"
4866 " ON c.casttarget = tt.oid\n"
4867 " LEFT JOIN pg_catalog.pg_namespace nt\n"
4868 " ON nt.oid = tt.typnamespace\n");
4872 " LEFT JOIN pg_catalog.pg_description d\n"
4873 " ON d.classoid = c.tableoid AND d.objoid = "
4874 "c.oid AND d.objsubid = 0\n");
4883 "ns.nspname",
"ts.typname",
4884 "pg_catalog.format_type(ts.oid, NULL)",
4885 "pg_catalog.pg_type_is_visible(ts.oid)",
4892 "nt.nspname",
"tt.typname",
4893 "pg_catalog.format_type(tt.oid, NULL)",
4894 "pg_catalog.pg_type_is_visible(tt.oid)",
4905 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 4926 of file describe.c.
4931 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
true,
false};
4937 " n.nspname AS \"%s\",\n"
4938 " c.collname AS \"%s\",\n",
4944 " CASE c.collprovider WHEN 'd' THEN 'default' WHEN 'b' THEN 'builtin' WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS \"%s\",\n",
4948 " 'libc' AS \"%s\",\n",
4952 " c.collcollate AS \"%s\",\n"
4953 " c.collctype AS \"%s\",\n",
4959 " c.colllocale AS \"%s\",\n",
4963 " c.colliculocale AS \"%s\",\n",
4967 " c.collcollate AS \"%s\",\n",
4972 " c.collicurules AS \"%s\",\n",
4976 " NULL AS \"%s\",\n",
4981 " CASE WHEN c.collisdeterministic THEN '%s' ELSE '%s' END AS \"%s\"",
4992 ",\n pg_catalog.obj_description(c.oid, 'pg_collation') AS \"%s\"",
4996 "\nFROM pg_catalog.pg_collation c, pg_catalog.pg_namespace n\n"
4997 "WHERE n.oid = c.collnamespace\n");
4999 if (!showSystem && !pattern)
5001 " AND n.nspname <> 'information_schema'\n");
5009 appendPQExpBufferStr(&
buf,
" AND c.collencoding IN (-1, pg_catalog.pg_char_to_encoding(pg_catalog.getdatabaseencoding()))\n");
5012 "n.nspname",
"c.collname", NULL,
5013 "pg_catalog.pg_collation_is_visible(c.oid)",
5027 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 4484 of file describe.c.
4489 static const bool translate_columns[] =
4490 {
false,
false,
false,
false,
true,
false};
4495 "SELECT n.nspname AS \"%s\",\n"
4496 " c.conname AS \"%s\",\n"
4497 " pg_catalog.pg_encoding_to_char(c.conforencoding) AS \"%s\",\n"
4498 " pg_catalog.pg_encoding_to_char(c.contoencoding) AS \"%s\",\n"
4499 " CASE WHEN c.condefault THEN '%s'\n"
4500 " ELSE '%s' END AS \"%s\"",
4510 ",\n d.description AS \"%s\"",
4514 "\nFROM pg_catalog.pg_conversion c\n"
4515 " JOIN pg_catalog.pg_namespace n "
4516 "ON n.oid = c.connamespace\n");
4520 "LEFT JOIN pg_catalog.pg_description d "
4521 "ON d.classoid = c.tableoid\n"
4522 " AND d.objoid = c.oid "
4523 "AND d.objsubid = 0\n");
4527 if (!showSystem && !pattern)
4529 " AND n.nspname <> 'information_schema'\n");
4532 "n.nspname",
"c.conname", NULL,
4533 "pg_catalog.pg_conversion_is_visible(c.oid)",
4547 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 3769 of file describe.c.
3779 "pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
3780 "FROM pg_catalog.pg_db_role_setting s\n"
3781 "LEFT JOIN pg_catalog.pg_database d ON d.oid = setdatabase\n"
3782 "LEFT JOIN pg_catalog.pg_roles r ON r.oid = setrole\n",
3787 NULL,
"r.rolname", NULL, NULL, &havewhere, 1))
3790 NULL,
"d.datname", NULL, NULL,
3808 if (pattern && pattern2)
3809 pg_log_error(
"Did not find any settings for role \"%s\" and database \"%s\".",
3812 pg_log_error(
"Did not find any settings for role \"%s\".",
3819 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 4401 of file describe.c.
4410 "SELECT n.nspname as \"%s\",\n"
4411 " t.typname as \"%s\",\n"
4412 " pg_catalog.format_type(t.typbasetype, t.typtypmod) as \"%s\",\n"
4413 " (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type bt\n"
4414 " WHERE c.oid = t.typcollation AND bt.oid = t.typbasetype AND t.typcollation <> bt.typcollation) as \"%s\",\n"
4415 " CASE WHEN t.typnotnull THEN 'not null' END as \"%s\",\n"
4416 " t.typdefault as \"%s\",\n"
4417 " pg_catalog.array_to_string(ARRAY(\n"
4418 " 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"
4419 " ), ' ') as \"%s\"",
4433 ",\n d.description as \"%s\"",
4438 "\nFROM pg_catalog.pg_type t\n"
4439 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
4443 " LEFT JOIN pg_catalog.pg_description d "
4444 "ON d.classoid = t.tableoid AND d.objoid = t.oid "
4445 "AND d.objsubid = 0\n");
4449 if (!showSystem && !pattern)
4451 " AND n.nspname <> 'information_schema'\n");
4454 "n.nspname",
"t.typname", NULL,
4455 "pg_catalog.pg_type_is_visible(t.oid)",
4469 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 4632 of file describe.c.
4637 static const bool translate_columns[] =
4638 {
false,
false,
false,
true,
false,
false,
false};
4644 pg_log_error(
"The server (version %s) does not support event triggers.",
4646 sverbuf,
sizeof(sverbuf)));
4653 "SELECT evtname as \"%s\", "
4654 "evtevent as \"%s\", "
4655 "pg_catalog.pg_get_userbyid(e.evtowner) as \"%s\",\n"
4656 " case evtenabled when 'O' then '%s'"
4657 " when 'R' then '%s'"
4658 " when 'A' then '%s'"
4659 " when 'D' then '%s' end as \"%s\",\n"
4660 " e.evtfoid::pg_catalog.regproc as \"%s\", "
4661 "pg_catalog.array_to_string(array(select x"
4662 " from pg_catalog.unnest(evttags) as t(x)), ', ') as \"%s\"",
4675 ",\npg_catalog.obj_description(e.oid, 'pg_event_trigger') as \"%s\"",
4678 "\nFROM pg_catalog.pg_event_trigger e ");
4681 NULL,
"evtname", NULL, NULL,
4695 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 4712 of file describe.c.
4722 pg_log_error(
"The server (version %s) does not support extended statistics.",
4724 sverbuf,
sizeof(sverbuf)));
4731 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text AS \"%s\", \n"
4732 "es.stxname AS \"%s\", \n",
4738 "pg_catalog.format('%%s FROM %%s', \n"
4739 " pg_catalog.pg_get_statisticsobjdef_columns(es.oid), \n"
4740 " es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4744 "pg_catalog.format('%%s FROM %%s', \n"
4745 " (SELECT pg_catalog.string_agg(pg_catalog.quote_ident(a.attname),', ') \n"
4746 " FROM pg_catalog.unnest(es.stxkeys) s(attnum) \n"
4747 " JOIN pg_catalog.pg_attribute a \n"
4748 " ON (es.stxrelid = a.attrelid \n"
4749 " AND a.attnum = s.attnum \n"
4750 " AND NOT a.attisdropped)), \n"
4751 "es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4755 ",\nCASE WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
4757 "CASE WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
4768 ",\nCASE WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
4774 " \nFROM pg_catalog.pg_statistic_ext es \n");
4778 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text",
"es.stxname",
4779 NULL,
"pg_catalog.pg_statistics_obj_is_visible(es.oid)",
4793 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 6071 of file describe.c.
6079 "SELECT e.extname, e.oid\n"
6080 "FROM pg_catalog.pg_extension e\n");
6084 NULL,
"e.extname", NULL,
6104 pg_log_error(
"Did not find any extension named \"%s\".",
6115 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 6020 of file describe.c.
6028 "SELECT e.extname AS \"%s\", "
6029 "e.extversion AS \"%s\", n.nspname AS \"%s\", c.description AS \"%s\"\n"
6030 "FROM pg_catalog.pg_extension e "
6031 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace "
6032 "LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid "
6033 "AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n",
6041 NULL,
"e.extname", NULL,
6056 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 5746 of file describe.c.
5754 "SELECT fdw.fdwname AS \"%s\",\n"
5755 " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n"
5756 " fdw.fdwhandler::pg_catalog.regproc AS \"%s\",\n"
5757 " fdw.fdwvalidator::pg_catalog.regproc AS \"%s\"",
5768 ",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
5769 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5770 " pg_catalog.quote_ident(option_name) || ' ' || "
5771 " pg_catalog.quote_literal(option_value) FROM "
5772 " pg_catalog.pg_options_to_table(fdwoptions)), ', ') || ')' "
5774 ",\n d.description AS \"%s\" ",
5783 "LEFT JOIN pg_catalog.pg_description d\n"
5784 " ON d.classoid = fdw.tableoid "
5785 "AND d.objoid = fdw.oid AND d.objsubid = 0\n");
5788 NULL,
"fdwname", NULL, NULL,
5802 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 5817 of file describe.c.
5825 "SELECT s.srvname AS \"%s\",\n"
5826 " pg_catalog.pg_get_userbyid(s.srvowner) AS \"%s\",\n"
5827 " f.fdwname AS \"%s\"",
5838 " s.srvtype AS \"%s\",\n"
5839 " s.srvversion AS \"%s\",\n"
5840 " CASE WHEN srvoptions IS NULL THEN '' ELSE "
5841 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5842 " pg_catalog.quote_ident(option_name) || ' ' || "
5843 " pg_catalog.quote_literal(option_value) FROM "
5844 " pg_catalog.pg_options_to_table(srvoptions)), ', ') || ')' "
5846 " d.description AS \"%s\"",
5854 "\nFROM pg_catalog.pg_foreign_server s\n"
5855 " JOIN pg_catalog.pg_foreign_data_wrapper f ON f.oid=s.srvfdw\n");
5859 "LEFT JOIN pg_catalog.pg_description d\n "
5860 "ON d.classoid = s.tableoid AND d.objoid = s.oid "
5861 "AND d.objsubid = 0\n");
5864 NULL,
"s.srvname", NULL, NULL,
5878 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 5948 of file describe.c.
5956 "SELECT n.nspname AS \"%s\",\n"
5957 " c.relname AS \"%s\",\n"
5958 " s.srvname AS \"%s\"",
5965 ",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
5966 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5967 " pg_catalog.quote_ident(option_name) || ' ' || "
5968 " pg_catalog.quote_literal(option_value) FROM "
5969 " pg_catalog.pg_options_to_table(ftoptions)), ', ') || ')' "
5971 " d.description AS \"%s\"",
5976 "\nFROM pg_catalog.pg_foreign_table ft\n"
5977 " INNER JOIN pg_catalog.pg_class c"
5978 " ON c.oid = ft.ftrelid\n"
5979 " INNER JOIN pg_catalog.pg_namespace n"
5980 " ON n.oid = c.relnamespace\n"
5981 " INNER JOIN pg_catalog.pg_foreign_server s"
5982 " ON s.oid = ft.ftserver\n");
5985 " LEFT JOIN pg_catalog.pg_description d\n"
5986 " ON d.classoid = c.tableoid AND "
5987 "d.objoid = c.oid AND d.objsubid = 0\n");
5990 "n.nspname",
"c.relname", NULL,
5991 "pg_catalog.pg_table_is_visible(c.oid)",
6005 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 4325 of file describe.c.
4334 "SELECT l.lanname AS \"%s\",\n"
4335 " pg_catalog.pg_get_userbyid(l.lanowner) as \"%s\",\n"
4336 " l.lanpltrusted AS \"%s\"",
4344 ",\n NOT l.lanispl AS \"%s\",\n"
4345 " l.lanplcallfoid::pg_catalog.regprocedure AS \"%s\",\n"
4346 " l.lanvalidator::pg_catalog.regprocedure AS \"%s\",\n "
4347 "l.laninline::pg_catalog.regprocedure AS \"%s\",\n ",
4356 ",\n d.description AS \"%s\""
4357 "\nFROM pg_catalog.pg_language l\n"
4358 "LEFT JOIN pg_catalog.pg_description d\n"
4359 " ON d.classoid = l.tableoid AND d.objoid = l.oid\n"
4360 " AND d.objsubid = 0\n",
4366 NULL,
"l.lanname", NULL, NULL,
4374 if (!showSystem && !pattern)
4385 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 7072 of file describe.c.
7081 "SELECT oid as \"%s\",\n"
7082 " pg_catalog.pg_get_userbyid(lomowner) as \"%s\",\n ",
7093 "pg_catalog.obj_description(oid, 'pg_largeobject') as \"%s\"\n"
7094 "FROM pg_catalog.pg_largeobject_metadata\n"
7103 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 6695 of file describe.c.
6701 bool have_where =
false;
6702 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false};
6708 " am.amname AS \"%s\",\n"
6709 " pg_catalog.format_type(c.opcintype, NULL) AS \"%s\",\n"
6711 " WHEN c.opckeytype <> 0 AND c.opckeytype <> c.opcintype\n"
6712 " THEN pg_catalog.format_type(c.opckeytype, NULL)\n"
6716 " WHEN pg_catalog.pg_opclass_is_visible(c.oid)\n"
6717 " THEN pg_catalog.format('%%I', c.opcname)\n"
6718 " ELSE pg_catalog.format('%%I.%%I', n.nspname, c.opcname)\n"
6720 " (CASE WHEN c.opcdefault\n"
6734 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6735 " THEN pg_catalog.format('%%I', of.opfname)\n"
6736 " ELSE pg_catalog.format('%%I.%%I', ofn.nspname, of.opfname)\n"
6738 " pg_catalog.pg_get_userbyid(c.opcowner) AS \"%s\"\n",
6742 "\nFROM pg_catalog.pg_opclass c\n"
6743 " LEFT JOIN pg_catalog.pg_am am on am.oid = c.opcmethod\n"
6744 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.opcnamespace\n"
6745 " LEFT JOIN pg_catalog.pg_type t ON t.oid = c.opcintype\n"
6746 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n");
6749 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = c.opcfamily\n"
6750 " LEFT JOIN pg_catalog.pg_namespace ofn ON ofn.oid = of.opfnamespace\n");
6752 if (access_method_pattern)
6754 false,
false, NULL,
"am.amname", NULL, NULL,
6761 "tn.nspname",
"t.typname",
6762 "pg_catalog.format_type(t.oid, NULL)",
6763 "pg_catalog.pg_type_is_visible(t.oid)",
6774 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 6796 of file describe.c.
6802 bool have_where =
false;
6803 static const bool translate_columns[] = {
false,
false,
false,
false};
6809 " am.amname AS \"%s\",\n"
6811 " WHEN pg_catalog.pg_opfamily_is_visible(f.oid)\n"
6812 " THEN pg_catalog.format('%%I', f.opfname)\n"
6813 " ELSE pg_catalog.format('%%I.%%I', n.nspname, f.opfname)\n"
6816 " pg_catalog.string_agg(pg_catalog.format_type(oc.opcintype, NULL), ', ')\n"
6817 " FROM pg_catalog.pg_opclass oc\n"
6818 " WHERE oc.opcfamily = f.oid) \"%s\"",
6824 ",\n pg_catalog.pg_get_userbyid(f.opfowner) AS \"%s\"\n",
6827 "\nFROM pg_catalog.pg_opfamily f\n"
6828 " LEFT JOIN pg_catalog.pg_am am on am.oid = f.opfmethod\n"
6829 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = f.opfnamespace\n");
6831 if (access_method_pattern)
6833 false,
false, NULL,
"am.amname", NULL, NULL,
6841 " FROM pg_catalog.pg_type t\n"
6842 " JOIN pg_catalog.pg_opclass oc ON oc.opcintype = t.oid\n"
6843 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n"
6844 " WHERE oc.opcfamily = f.oid\n",
6845 have_where ?
"AND" :
"WHERE");
6848 "tn.nspname",
"t.typname",
6849 "pg_catalog.format_type(t.oid, NULL)",
6850 "pg_catalog.pg_type_is_visible(t.oid)",
6862 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 6983 of file describe.c.
6989 bool have_where =
false;
6990 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
6996 " am.amname AS \"%s\",\n"
6998 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6999 " THEN pg_catalog.format('%%I', of.opfname)\n"
7000 " ELSE pg_catalog.format('%%I.%%I', ns.nspname, of.opfname)\n"
7002 " pg_catalog.format_type(ap.amproclefttype, NULL) AS \"%s\",\n"
7003 " pg_catalog.format_type(ap.amprocrighttype, NULL) AS \"%s\",\n"
7004 " ap.amprocnum AS \"%s\"\n",
7013 ", p.proname AS \"%s\"\n",
7017 ", ap.amproc::pg_catalog.regprocedure AS \"%s\"\n",
7021 "FROM pg_catalog.pg_amproc ap\n"
7022 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = ap.amprocfamily\n"
7023 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod\n"
7024 " LEFT JOIN pg_catalog.pg_namespace ns ON of.opfnamespace = ns.oid\n"
7025 " LEFT JOIN pg_catalog.pg_proc p ON ap.amproc = p.oid\n");
7027 if (access_method_pattern)
7030 false,
false, NULL,
"am.amname",
7038 "ns.nspname",
"of.opfname", NULL, NULL,
7044 " ap.amproclefttype = ap.amprocrighttype DESC,\n"
7052 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 6885 of file describe.c.
6891 bool have_where =
false;
6893 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
6899 " am.amname AS \"%s\",\n"
6901 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6902 " THEN pg_catalog.format('%%I', of.opfname)\n"
6903 " ELSE pg_catalog.format('%%I.%%I', nsf.nspname, of.opfname)\n"
6905 " o.amopopr::pg_catalog.regoperator AS \"%s\"\n,"
6906 " o.amopstrategy AS \"%s\",\n"
6907 " CASE o.amoppurpose\n"
6908 " WHEN 'o' THEN '%s'\n"
6909 " WHEN 's' THEN '%s'\n"
6921 ", ofs.opfname AS \"%s\"\n",
6924 "FROM pg_catalog.pg_amop o\n"
6925 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = o.amopfamily\n"
6926 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod AND am.oid = o.amopmethod\n"
6927 " LEFT JOIN pg_catalog.pg_namespace nsf ON of.opfnamespace = nsf.oid\n");
6930 " LEFT JOIN pg_catalog.pg_opfamily ofs ON ofs.oid = o.amopsortfamily\n");
6932 if (access_method_pattern)
6935 false,
false, NULL,
"am.amname",
6944 "nsf.nspname",
"of.opfname", NULL, NULL,
6950 " o.amoplefttype = o.amoprighttype DESC,\n"
6951 " pg_catalog.format_type(o.amoplefttype, NULL),\n"
6952 " pg_catalog.format_type(o.amoprighttype, NULL),\n"
6953 " o.amopstrategy;");
6960 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 4115 of file describe.c.
4117 bool showTables = strchr(reltypes,
't') != NULL;
4118 bool showIndexes = strchr(reltypes,
'i') != NULL;
4119 bool showNested = strchr(reltypes,
'n') != NULL;
4124 bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
false};
4125 const char *tabletitle;
4126 bool mixed_output =
false;
4135 pg_log_error(
"The server (version %s) does not support declarative table partitioning.",
4137 sverbuf,
sizeof(sverbuf)));
4142 if (!showTables && !showIndexes)
4143 showTables = showIndexes =
true;
4145 if (showIndexes && !showTables)
4146 tabletitle =
_(
"List of partitioned indexes");
4147 else if (showTables && !showIndexes)
4148 tabletitle =
_(
"List of partitioned tables");
4152 tabletitle =
_(
"List of partitioned relations");
4153 mixed_output =
true;
4159 "SELECT n.nspname as \"%s\",\n"
4160 " c.relname as \"%s\",\n"
4161 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
4169 ",\n CASE c.relkind"
4170 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
4171 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
4177 translate_columns[3] =
true;
4180 if (showNested || pattern)
4182 ",\n inh.inhparent::pg_catalog.regclass as \"%s\"",
4187 ",\n c2.oid::pg_catalog.regclass as \"%s\"",
4202 ",\n s.dps as \"%s\"",
4205 ",\n s.tps as \"%s\"",
4211 ",\n s.tps as \"%s\"",
4215 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4220 "\nFROM pg_catalog.pg_class c"
4221 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4225 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4226 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4228 if (showNested || pattern)
4230 "\n LEFT JOIN pg_catalog.pg_inherits inh ON c.oid = inh.inhrelid");
4235 "\n LEFT JOIN pg_catalog.pg_am am ON c.relam = am.oid");
4240 ",\n LATERAL (WITH RECURSIVE d\n"
4241 " AS (SELECT inhrelid AS oid, 1 AS level\n"
4242 " FROM pg_catalog.pg_inherits\n"
4243 " WHERE inhparent = c.oid\n"
4245 " SELECT inhrelid, level + 1\n"
4246 " FROM pg_catalog.pg_inherits i\n"
4247 " JOIN d ON i.inhparent = d.oid)\n"
4248 " SELECT pg_catalog.pg_size_pretty(sum(pg_catalog.pg_table_size("
4249 "d.oid))) AS tps,\n"
4250 " pg_catalog.pg_size_pretty(sum("
4251 "\n CASE WHEN d.level = 1"
4252 " THEN pg_catalog.pg_table_size(d.oid) ELSE 0 END)) AS dps\n"
4259 ",\n LATERAL (SELECT pg_catalog.pg_size_pretty(sum("
4260 "\n CASE WHEN ppt.isleaf AND ppt.level = 1"
4261 "\n THEN pg_catalog.pg_table_size(ppt.relid)"
4262 " ELSE 0 END)) AS dps"
4263 ",\n pg_catalog.pg_size_pretty(sum("
4264 "pg_catalog.pg_table_size(ppt.relid))) AS tps"
4265 "\n FROM pg_catalog.pg_partition_tree(c.oid) ppt) s");
4278 " AND NOT c.relispartition\n" :
"");
4282 " AND n.nspname !~ '^pg_toast'\n"
4283 " AND n.nspname <> 'information_schema'\n");
4286 "n.nspname",
"c.relname", NULL,
4287 "pg_catalog.pg_table_is_visible(c.oid)",
4295 mixed_output ?
"\"Type\" DESC, " :
"",
4296 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 6235 of file describe.c.
6240 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false};
6246 pg_log_error(
"The server (version %s) does not support publications.",
6248 sverbuf,
sizeof(sverbuf)));
6255 "SELECT pubname AS \"%s\",\n"
6256 " pg_catalog.pg_get_userbyid(pubowner) AS \"%s\",\n"
6257 " puballtables AS \"%s\",\n"
6258 " pubinsert AS \"%s\",\n"
6259 " pubupdate AS \"%s\",\n"
6260 " pubdelete AS \"%s\"",
6269 ",\n pubtruncate AS \"%s\"",
6273 ",\n pubviaroot AS \"%s\"",
6277 "\nFROM pg_catalog.pg_publication\n");
6280 NULL,
"pubname", NULL,
6295 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 5044 of file describe.c.
5049 int pub_schema_tuples = 0;
5050 char **footers = NULL;
5054 "SELECT n.nspname AS \"%s\",\n"
5055 " pg_catalog.pg_get_userbyid(n.nspowner) AS \"%s\"",
5064 ",\n pg_catalog.obj_description(n.oid, 'pg_namespace') AS \"%s\"",
5069 "\nFROM pg_catalog.pg_namespace n\n");
5071 if (!showSystem && !pattern)
5073 "WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'\n");
5076 !showSystem && !pattern,
false,
5077 NULL,
"n.nspname", NULL,
5088 myopt.
title =
_(
"List of schemas");
5098 "FROM pg_catalog.pg_publication p\n"
5099 " JOIN pg_catalog.pg_publication_namespace pn ON p.oid = pn.pnpubid\n"
5100 " JOIN pg_catalog.pg_namespace n ON n.oid = pn.pnnspid \n"
5101 "WHERE n.nspname = '%s'\n"
5110 if (pub_schema_tuples > 0)
5117 footers = (
char **)
pg_malloc((1 + pub_schema_tuples + 1) *
sizeof(
char *));
5121 for (
i = 0;
i < pub_schema_tuples;
i++)
5129 footers[
i + 1] = NULL;
5144 char **footer = NULL;
5146 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 3917 of file describe.c.
3919 bool showTables = strchr(tabtypes,
't') != NULL;
3920 bool showIndexes = strchr(tabtypes,
'i') != NULL;
3921 bool showViews = strchr(tabtypes,
'v') != NULL;
3922 bool showMatViews = strchr(tabtypes,
'm') != NULL;
3923 bool showSeq = strchr(tabtypes,
's') != NULL;
3924 bool showForeign = strchr(tabtypes,
'E') != NULL;
3930 bool translate_columns[] = {
false,
false,
true,
false,
false,
false,
false,
false,
false};
3933 if (!(showTables || showIndexes || showViews || showMatViews || showSeq || showForeign))
3934 showTables = showViews = showMatViews = showSeq = showForeign =
true;
3939 "SELECT n.nspname as \"%s\",\n"
3940 " c.relname as \"%s\",\n"
3948 " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE)
" THEN '%s'"
3949 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
3950 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
3952 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
3971 ",\n c2.relname as \"%s\"",
3982 ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"",
3987 translate_columns[cols_so_far] =
true;
3999 (showTables || showMatViews || showIndexes))
4001 ",\n am.amname as \"%s\"",
4005 ",\n pg_catalog.pg_size_pretty(pg_catalog.pg_table_size(c.oid)) as \"%s\""
4006 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4012 "\nFROM pg_catalog.pg_class c"
4013 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4016 (showTables || showMatViews || showIndexes))
4018 "\n LEFT JOIN pg_catalog.pg_am am ON am.oid = c.relam");
4022 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4023 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4031 if (showSystem || pattern)
4043 if (showSystem || pattern)
4051 if (!showSystem && !pattern)
4053 " AND n.nspname !~ '^pg_toast'\n"
4054 " AND n.nspname <> 'information_schema'\n");
4057 "n.nspname",
"c.relname", NULL,
4058 "pg_catalog.pg_table_is_visible(c.oid)",
4080 pg_log_error(
"Did not find any relation named \"%s\".",
4087 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 5542 of file describe.c.
5555 " n.nspname as \"%s\",\n"
5556 " c.cfgname as \"%s\",\n"
5557 " pg_catalog.obj_description(c.oid, 'pg_ts_config') as \"%s\"\n"
5558 "FROM pg_catalog.pg_ts_config c\n"
5559 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.cfgnamespace\n",
5566 "n.nspname",
"c.cfgname", NULL,
5567 "pg_catalog.pg_ts_config_is_visible(c.oid)",
5581 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 5412 of file describe.c.
5422 " n.nspname as \"%s\",\n"
5423 " d.dictname as \"%s\",\n",
5430 " ( SELECT COALESCE(nt.nspname, '(null)')::pg_catalog.text || '.' || t.tmplname FROM\n"
5431 " pg_catalog.pg_ts_template t\n"
5432 " LEFT JOIN pg_catalog.pg_namespace nt ON nt.oid = t.tmplnamespace\n"
5433 " WHERE d.dicttemplate = t.oid ) AS \"%s\",\n"
5434 " d.dictinitoption as \"%s\",\n",
5440 " pg_catalog.obj_description(d.oid, 'pg_ts_dict') as \"%s\"\n",
5444 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.dictnamespace\n");
5447 "n.nspname",
"d.dictname", NULL,
5448 "pg_catalog.pg_ts_dict_is_visible(d.oid)",
5462 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 5165 of file describe.c.
5178 " n.nspname as \"%s\",\n"
5179 " p.prsname as \"%s\",\n"
5180 " pg_catalog.obj_description(p.oid, 'pg_ts_parser') as \"%s\"\n"
5181 "FROM pg_catalog.pg_ts_parser p\n"
5182 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.prsnamespace\n",
5189 "n.nspname",
"p.prsname", NULL,
5190 "pg_catalog.pg_ts_parser_is_visible(p.oid)",
5204 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 5477 of file describe.c.
5488 " n.nspname AS \"%s\",\n"
5489 " t.tmplname AS \"%s\",\n"
5490 " t.tmplinit::pg_catalog.regproc AS \"%s\",\n"
5491 " t.tmpllexize::pg_catalog.regproc AS \"%s\",\n"
5492 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5501 " n.nspname AS \"%s\",\n"
5502 " t.tmplname AS \"%s\",\n"
5503 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5509 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.tmplnamespace\n");
5512 "n.nspname",
"t.tmplname", NULL,
5513 "pg_catalog.pg_ts_template_is_visible(t.oid)",
5527 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 5893 of file describe.c.
5901 "SELECT um.srvname AS \"%s\",\n"
5902 " um.usename AS \"%s\"",
5908 ",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
5909 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5910 " pg_catalog.quote_ident(option_name) || ' ' || "
5911 " pg_catalog.quote_literal(option_value) FROM "
5912 " pg_catalog.pg_options_to_table(umoptions)), ', ') || ')' "
5919 NULL,
"um.srvname",
"um.usename", NULL,
5933 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().