|
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 4556 of file describe.c.
4565 "SELECT s.name AS \"%s\", "
4566 "pg_catalog.current_setting(s.name) AS \"%s\"",
4573 ", s.vartype AS \"%s\", s.context AS \"%s\", ",
4587 " LEFT JOIN pg_catalog.pg_parameter_acl p\n"
4588 " ON pg_catalog.lower(s.name) = p.parname\n");
4593 NULL,
"pg_catalog.lower(s.name)", NULL,
4597 " s.setting IS DISTINCT FROM s.boot_val\n");
4607 myopt.
title =
_(
"List of configuration parameters");
4609 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 6349 of file describe.c.
6354 bool has_pubtruncate;
6355 bool has_pubviaroot;
6364 pg_log_error(
"The server (version %s) does not support publications.",
6366 sverbuf,
sizeof(sverbuf)));
6376 "SELECT oid, pubname,\n"
6377 " pg_catalog.pg_get_userbyid(pubowner) AS owner,\n"
6378 " puballtables, pubinsert, pubupdate, pubdelete");
6379 if (has_pubtruncate)
6386 "\nFROM pg_catalog.pg_publication\n");
6389 NULL,
"pubname", NULL,
6411 pg_log_error(
"Did not find any publication named \"%s\".",
6424 const char align =
'l';
6432 if (has_pubtruncate)
6446 if (has_pubtruncate)
6456 if (has_pubtruncate)
6465 "SELECT n.nspname, c.relname");
6469 ", pg_get_expr(pr.prqual, c.oid)");
6471 ", (CASE WHEN pr.prattrs IS NOT NULL THEN\n"
6472 " pg_catalog.array_to_string("
6473 " ARRAY(SELECT attname\n"
6475 " pg_catalog.generate_series(0, pg_catalog.array_upper(pr.prattrs::pg_catalog.int2[], 1)) s,\n"
6476 " pg_catalog.pg_attribute\n"
6477 " WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n"
6484 "\nFROM pg_catalog.pg_class c,\n"
6485 " pg_catalog.pg_namespace n,\n"
6486 " pg_catalog.pg_publication_rel pr\n"
6487 "WHERE c.relnamespace = n.oid\n"
6488 " AND c.oid = pr.prrelid\n"
6489 " AND pr.prpubid = '%s'\n"
6490 "ORDER BY 1,2", pubid);
6498 "SELECT n.nspname\n"
6499 "FROM pg_catalog.pg_namespace n\n"
6500 " JOIN pg_catalog.pg_publication_namespace pn ON n.oid = pn.pnnspid\n"
6501 "WHERE pn.pnpubid = '%s'\n"
6502 "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 3830 of file describe.c.
3838 "SELECT m.rolname AS \"%s\", r.rolname AS \"%s\",\n"
3839 " pg_catalog.concat_ws(', ',\n",
3845 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3846 " CASE WHEN pam.inherit_option THEN 'INHERIT' END,\n"
3847 " CASE WHEN pam.set_option THEN 'SET' END\n");
3850 " CASE WHEN pam.admin_option THEN 'ADMIN' END,\n"
3851 " CASE WHEN m.rolinherit THEN 'INHERIT' END,\n"
3856 " g.rolname AS \"%s\"\n",
3861 "FROM pg_catalog.pg_roles m\n"
3862 " JOIN pg_catalog.pg_auth_members pam ON (pam.member = m.oid)\n"
3863 " LEFT JOIN pg_catalog.pg_roles r ON (pam.roleid = r.oid)\n"
3864 " LEFT JOIN pg_catalog.pg_roles g ON (pam.grantor = g.oid)\n");
3866 if (!showSystem && !pattern)
3870 NULL,
"m.rolname", NULL, NULL,
3884 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 3614 of file describe.c.
3624 const char align =
'l';
3632 "SELECT r.rolname, r.rolsuper, r.rolinherit,\n"
3633 " r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,\n"
3634 " r.rolconnlimit, r.rolvaliduntil");
3650 if (!showSystem && !pattern)
3654 NULL,
"r.rolname", NULL, NULL,
3668 attr =
pg_malloc0((nrows + 1) *
sizeof(*attr));
3678 for (
i = 0;
i < nrows;
i++)
3740 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 6535 of file describe.c.
6540 static const bool translate_columns[] = {
false,
false,
false,
false,
6541 false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
6548 pg_log_error(
"The server (version %s) does not support subscriptions.",
6550 sverbuf,
sizeof(sverbuf)));
6557 "SELECT subname AS \"%s\"\n"
6558 ", pg_catalog.pg_get_userbyid(subowner) AS \"%s\"\n"
6559 ", subenabled AS \"%s\"\n"
6560 ", subpublications AS \"%s\"\n",
6572 ", subbinary AS \"%s\"\n",
6577 ", (CASE substream\n"
6578 " WHEN 'f' THEN 'off'\n"
6579 " WHEN 't' THEN 'on'\n"
6580 " WHEN 'p' THEN 'parallel'\n"
6581 " END) AS \"%s\"\n",
6585 ", substream AS \"%s\"\n",
6592 ", subtwophasestate AS \"%s\"\n"
6593 ", subdisableonerr AS \"%s\"\n",
6599 ", suborigin AS \"%s\"\n"
6600 ", subpasswordrequired AS \"%s\"\n"
6601 ", subrunasowner AS \"%s\"\n",
6608 ", subfailover AS \"%s\"\n",
6612 ", subsynccommit AS \"%s\"\n"
6613 ", subconninfo AS \"%s\"\n",
6620 ", subskiplsn AS \"%s\"\n",
6626 "FROM pg_catalog.pg_subscription\n"
6627 "WHERE subdbid = (SELECT oid\n"
6628 " FROM pg_catalog.pg_database\n"
6629 " WHERE datname = pg_catalog.current_database())");
6632 NULL,
"subname", NULL,
6647 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 4800 of file describe.c.
4805 static const bool translate_columns[] = {
false,
false,
false,
true,
false};
4810 "SELECT pg_catalog.format_type(castsource, NULL) AS \"%s\",\n"
4811 " pg_catalog.format_type(casttarget, NULL) AS \"%s\",\n",
4821 " CASE WHEN c.castmethod = '%c' THEN '(binary coercible)'\n"
4822 " WHEN c.castmethod = '%c' THEN '(with inout)'\n"
4824 " END AS \"%s\",\n",
4825 COERCION_METHOD_BINARY,
4826 COERCION_METHOD_INOUT,
4830 " CASE WHEN c.castcontext = '%c' THEN '%s'\n"
4831 " WHEN c.castcontext = '%c' THEN '%s'\n"
4834 COERCION_CODE_EXPLICIT,
4836 COERCION_CODE_ASSIGNMENT,
4843 ",\n d.description AS \"%s\"",
4851 "\nFROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p\n"
4852 " ON c.castfunc = p.oid\n"
4853 " LEFT JOIN pg_catalog.pg_type ts\n"
4854 " ON c.castsource = ts.oid\n"
4855 " LEFT JOIN pg_catalog.pg_namespace ns\n"
4856 " ON ns.oid = ts.typnamespace\n"
4857 " LEFT JOIN pg_catalog.pg_type tt\n"
4858 " ON c.casttarget = tt.oid\n"
4859 " LEFT JOIN pg_catalog.pg_namespace nt\n"
4860 " ON nt.oid = tt.typnamespace\n");
4864 " LEFT JOIN pg_catalog.pg_description d\n"
4865 " ON d.classoid = c.tableoid AND d.objoid = "
4866 "c.oid AND d.objsubid = 0\n");
4875 "ns.nspname",
"ts.typname",
4876 "pg_catalog.format_type(ts.oid, NULL)",
4877 "pg_catalog.pg_type_is_visible(ts.oid)",
4884 "nt.nspname",
"tt.typname",
4885 "pg_catalog.format_type(tt.oid, NULL)",
4886 "pg_catalog.pg_type_is_visible(tt.oid)",
4897 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 4918 of file describe.c.
4923 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
true,
false};
4929 " n.nspname AS \"%s\",\n"
4930 " c.collname AS \"%s\",\n",
4936 " CASE c.collprovider WHEN 'd' THEN 'default' WHEN 'b' THEN 'builtin' WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS \"%s\",\n",
4940 " 'libc' AS \"%s\",\n",
4944 " c.collcollate AS \"%s\",\n"
4945 " c.collctype AS \"%s\",\n",
4951 " c.colllocale AS \"%s\",\n",
4955 " c.colliculocale AS \"%s\",\n",
4959 " c.collcollate AS \"%s\",\n",
4964 " c.collicurules AS \"%s\",\n",
4968 " NULL AS \"%s\",\n",
4973 " CASE WHEN c.collisdeterministic THEN '%s' ELSE '%s' END AS \"%s\"",
4984 ",\n pg_catalog.obj_description(c.oid, 'pg_collation') AS \"%s\"",
4988 "\nFROM pg_catalog.pg_collation c, pg_catalog.pg_namespace n\n"
4989 "WHERE n.oid = c.collnamespace\n");
4991 if (!showSystem && !pattern)
4993 " AND n.nspname <> 'information_schema'\n");
5001 appendPQExpBufferStr(&
buf,
" AND c.collencoding IN (-1, pg_catalog.pg_char_to_encoding(pg_catalog.getdatabaseencoding()))\n");
5004 "n.nspname",
"c.collname", NULL,
5005 "pg_catalog.pg_collation_is_visible(c.oid)",
5019 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 4476 of file describe.c.
4481 static const bool translate_columns[] =
4482 {
false,
false,
false,
false,
true,
false};
4487 "SELECT n.nspname AS \"%s\",\n"
4488 " c.conname AS \"%s\",\n"
4489 " pg_catalog.pg_encoding_to_char(c.conforencoding) AS \"%s\",\n"
4490 " pg_catalog.pg_encoding_to_char(c.contoencoding) AS \"%s\",\n"
4491 " CASE WHEN c.condefault THEN '%s'\n"
4492 " ELSE '%s' END AS \"%s\"",
4502 ",\n d.description AS \"%s\"",
4506 "\nFROM pg_catalog.pg_conversion c\n"
4507 " JOIN pg_catalog.pg_namespace n "
4508 "ON n.oid = c.connamespace\n");
4512 "LEFT JOIN pg_catalog.pg_description d "
4513 "ON d.classoid = c.tableoid\n"
4514 " AND d.objoid = c.oid "
4515 "AND d.objsubid = 0\n");
4519 if (!showSystem && !pattern)
4521 " AND n.nspname <> 'information_schema'\n");
4524 "n.nspname",
"c.conname", NULL,
4525 "pg_catalog.pg_conversion_is_visible(c.oid)",
4539 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 3761 of file describe.c.
3771 "pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
3772 "FROM pg_catalog.pg_db_role_setting s\n"
3773 "LEFT JOIN pg_catalog.pg_database d ON d.oid = setdatabase\n"
3774 "LEFT JOIN pg_catalog.pg_roles r ON r.oid = setrole\n",
3779 NULL,
"r.rolname", NULL, NULL, &havewhere, 1))
3782 NULL,
"d.datname", NULL, NULL,
3800 if (pattern && pattern2)
3801 pg_log_error(
"Did not find any settings for role \"%s\" and database \"%s\".",
3804 pg_log_error(
"Did not find any settings for role \"%s\".",
3811 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 4393 of file describe.c.
4402 "SELECT n.nspname as \"%s\",\n"
4403 " t.typname as \"%s\",\n"
4404 " pg_catalog.format_type(t.typbasetype, t.typtypmod) as \"%s\",\n"
4405 " (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type bt\n"
4406 " WHERE c.oid = t.typcollation AND bt.oid = t.typbasetype AND t.typcollation <> bt.typcollation) as \"%s\",\n"
4407 " CASE WHEN t.typnotnull THEN 'not null' END as \"%s\",\n"
4408 " t.typdefault as \"%s\",\n"
4409 " pg_catalog.array_to_string(ARRAY(\n"
4410 " 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"
4411 " ), ' ') as \"%s\"",
4425 ",\n d.description as \"%s\"",
4430 "\nFROM pg_catalog.pg_type t\n"
4431 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace\n");
4435 " LEFT JOIN pg_catalog.pg_description d "
4436 "ON d.classoid = t.tableoid AND d.objoid = t.oid "
4437 "AND d.objsubid = 0\n");
4441 if (!showSystem && !pattern)
4443 " AND n.nspname <> 'information_schema'\n");
4446 "n.nspname",
"t.typname", NULL,
4447 "pg_catalog.pg_type_is_visible(t.oid)",
4461 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 4624 of file describe.c.
4629 static const bool translate_columns[] =
4630 {
false,
false,
false,
true,
false,
false,
false};
4636 pg_log_error(
"The server (version %s) does not support event triggers.",
4638 sverbuf,
sizeof(sverbuf)));
4645 "SELECT evtname as \"%s\", "
4646 "evtevent as \"%s\", "
4647 "pg_catalog.pg_get_userbyid(e.evtowner) as \"%s\",\n"
4648 " case evtenabled when 'O' then '%s'"
4649 " when 'R' then '%s'"
4650 " when 'A' then '%s'"
4651 " when 'D' then '%s' end as \"%s\",\n"
4652 " e.evtfoid::pg_catalog.regproc as \"%s\", "
4653 "pg_catalog.array_to_string(array(select x"
4654 " from pg_catalog.unnest(evttags) as t(x)), ', ') as \"%s\"",
4667 ",\npg_catalog.obj_description(e.oid, 'pg_event_trigger') as \"%s\"",
4670 "\nFROM pg_catalog.pg_event_trigger e ");
4673 NULL,
"evtname", NULL, NULL,
4687 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 4704 of file describe.c.
4714 pg_log_error(
"The server (version %s) does not support extended statistics.",
4716 sverbuf,
sizeof(sverbuf)));
4723 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text AS \"%s\", \n"
4724 "es.stxname AS \"%s\", \n",
4730 "pg_catalog.format('%%s FROM %%s', \n"
4731 " pg_catalog.pg_get_statisticsobjdef_columns(es.oid), \n"
4732 " es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4736 "pg_catalog.format('%%s FROM %%s', \n"
4737 " (SELECT pg_catalog.string_agg(pg_catalog.quote_ident(a.attname),', ') \n"
4738 " FROM pg_catalog.unnest(es.stxkeys) s(attnum) \n"
4739 " JOIN pg_catalog.pg_attribute a \n"
4740 " ON (es.stxrelid = a.attrelid \n"
4741 " AND a.attnum = s.attnum \n"
4742 " AND NOT a.attisdropped)), \n"
4743 "es.stxrelid::pg_catalog.regclass) AS \"%s\"",
4747 ",\nCASE WHEN 'd' = any(es.stxkind) THEN 'defined' \n"
4749 "CASE WHEN 'f' = any(es.stxkind) THEN 'defined' \n"
4760 ",\nCASE WHEN 'm' = any(es.stxkind) THEN 'defined' \n"
4766 " \nFROM pg_catalog.pg_statistic_ext es \n");
4770 "es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text",
"es.stxname",
4771 NULL,
"pg_catalog.pg_statistics_obj_is_visible(es.oid)",
4785 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 6063 of file describe.c.
6071 "SELECT e.extname, e.oid\n"
6072 "FROM pg_catalog.pg_extension e\n");
6076 NULL,
"e.extname", NULL,
6096 pg_log_error(
"Did not find any extension named \"%s\".",
6107 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 6012 of file describe.c.
6020 "SELECT e.extname AS \"%s\", "
6021 "e.extversion AS \"%s\", n.nspname AS \"%s\", c.description AS \"%s\"\n"
6022 "FROM pg_catalog.pg_extension e "
6023 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace "
6024 "LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid "
6025 "AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n",
6033 NULL,
"e.extname", NULL,
6048 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 5738 of file describe.c.
5746 "SELECT fdw.fdwname AS \"%s\",\n"
5747 " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n"
5748 " fdw.fdwhandler::pg_catalog.regproc AS \"%s\",\n"
5749 " fdw.fdwvalidator::pg_catalog.regproc AS \"%s\"",
5760 ",\n CASE WHEN fdwoptions IS NULL THEN '' ELSE "
5761 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5762 " pg_catalog.quote_ident(option_name) || ' ' || "
5763 " pg_catalog.quote_literal(option_value) FROM "
5764 " pg_catalog.pg_options_to_table(fdwoptions)), ', ') || ')' "
5766 ",\n d.description AS \"%s\" ",
5775 "LEFT JOIN pg_catalog.pg_description d\n"
5776 " ON d.classoid = fdw.tableoid "
5777 "AND d.objoid = fdw.oid AND d.objsubid = 0\n");
5780 NULL,
"fdwname", NULL, NULL,
5794 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 5809 of file describe.c.
5817 "SELECT s.srvname AS \"%s\",\n"
5818 " pg_catalog.pg_get_userbyid(s.srvowner) AS \"%s\",\n"
5819 " f.fdwname AS \"%s\"",
5830 " s.srvtype AS \"%s\",\n"
5831 " s.srvversion AS \"%s\",\n"
5832 " CASE WHEN srvoptions IS NULL THEN '' ELSE "
5833 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5834 " pg_catalog.quote_ident(option_name) || ' ' || "
5835 " pg_catalog.quote_literal(option_value) FROM "
5836 " pg_catalog.pg_options_to_table(srvoptions)), ', ') || ')' "
5838 " d.description AS \"%s\"",
5846 "\nFROM pg_catalog.pg_foreign_server s\n"
5847 " JOIN pg_catalog.pg_foreign_data_wrapper f ON f.oid=s.srvfdw\n");
5851 "LEFT JOIN pg_catalog.pg_description d\n "
5852 "ON d.classoid = s.tableoid AND d.objoid = s.oid "
5853 "AND d.objsubid = 0\n");
5856 NULL,
"s.srvname", NULL, NULL,
5870 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 5940 of file describe.c.
5948 "SELECT n.nspname AS \"%s\",\n"
5949 " c.relname AS \"%s\",\n"
5950 " s.srvname AS \"%s\"",
5957 ",\n CASE WHEN ftoptions IS NULL THEN '' ELSE "
5958 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5959 " pg_catalog.quote_ident(option_name) || ' ' || "
5960 " pg_catalog.quote_literal(option_value) FROM "
5961 " pg_catalog.pg_options_to_table(ftoptions)), ', ') || ')' "
5963 " d.description AS \"%s\"",
5968 "\nFROM pg_catalog.pg_foreign_table ft\n"
5969 " INNER JOIN pg_catalog.pg_class c"
5970 " ON c.oid = ft.ftrelid\n"
5971 " INNER JOIN pg_catalog.pg_namespace n"
5972 " ON n.oid = c.relnamespace\n"
5973 " INNER JOIN pg_catalog.pg_foreign_server s"
5974 " ON s.oid = ft.ftserver\n");
5977 " LEFT JOIN pg_catalog.pg_description d\n"
5978 " ON d.classoid = c.tableoid AND "
5979 "d.objoid = c.oid AND d.objsubid = 0\n");
5982 "n.nspname",
"c.relname", NULL,
5983 "pg_catalog.pg_table_is_visible(c.oid)",
5997 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 4317 of file describe.c.
4326 "SELECT l.lanname AS \"%s\",\n"
4327 " pg_catalog.pg_get_userbyid(l.lanowner) as \"%s\",\n"
4328 " l.lanpltrusted AS \"%s\"",
4336 ",\n NOT l.lanispl AS \"%s\",\n"
4337 " l.lanplcallfoid::pg_catalog.regprocedure AS \"%s\",\n"
4338 " l.lanvalidator::pg_catalog.regprocedure AS \"%s\",\n "
4339 "l.laninline::pg_catalog.regprocedure AS \"%s\",\n ",
4348 ",\n d.description AS \"%s\""
4349 "\nFROM pg_catalog.pg_language l\n"
4350 "LEFT JOIN pg_catalog.pg_description d\n"
4351 " ON d.classoid = l.tableoid AND d.objoid = l.oid\n"
4352 " AND d.objsubid = 0\n",
4358 NULL,
"l.lanname", NULL, NULL,
4366 if (!showSystem && !pattern)
4377 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 7064 of file describe.c.
7073 "SELECT oid as \"%s\",\n"
7074 " pg_catalog.pg_get_userbyid(lomowner) as \"%s\",\n ",
7085 "pg_catalog.obj_description(oid, 'pg_largeobject') as \"%s\"\n"
7086 "FROM pg_catalog.pg_largeobject_metadata\n"
7095 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 6687 of file describe.c.
6693 bool have_where =
false;
6694 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false};
6700 " am.amname AS \"%s\",\n"
6701 " pg_catalog.format_type(c.opcintype, NULL) AS \"%s\",\n"
6703 " WHEN c.opckeytype <> 0 AND c.opckeytype <> c.opcintype\n"
6704 " THEN pg_catalog.format_type(c.opckeytype, NULL)\n"
6708 " WHEN pg_catalog.pg_opclass_is_visible(c.oid)\n"
6709 " THEN pg_catalog.format('%%I', c.opcname)\n"
6710 " ELSE pg_catalog.format('%%I.%%I', n.nspname, c.opcname)\n"
6712 " (CASE WHEN c.opcdefault\n"
6726 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6727 " THEN pg_catalog.format('%%I', of.opfname)\n"
6728 " ELSE pg_catalog.format('%%I.%%I', ofn.nspname, of.opfname)\n"
6730 " pg_catalog.pg_get_userbyid(c.opcowner) AS \"%s\"\n",
6734 "\nFROM pg_catalog.pg_opclass c\n"
6735 " LEFT JOIN pg_catalog.pg_am am on am.oid = c.opcmethod\n"
6736 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.opcnamespace\n"
6737 " LEFT JOIN pg_catalog.pg_type t ON t.oid = c.opcintype\n"
6738 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n");
6741 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = c.opcfamily\n"
6742 " LEFT JOIN pg_catalog.pg_namespace ofn ON ofn.oid = of.opfnamespace\n");
6744 if (access_method_pattern)
6746 false,
false, NULL,
"am.amname", NULL, NULL,
6753 "tn.nspname",
"t.typname",
6754 "pg_catalog.format_type(t.oid, NULL)",
6755 "pg_catalog.pg_type_is_visible(t.oid)",
6766 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 6788 of file describe.c.
6794 bool have_where =
false;
6795 static const bool translate_columns[] = {
false,
false,
false,
false};
6801 " am.amname AS \"%s\",\n"
6803 " WHEN pg_catalog.pg_opfamily_is_visible(f.oid)\n"
6804 " THEN pg_catalog.format('%%I', f.opfname)\n"
6805 " ELSE pg_catalog.format('%%I.%%I', n.nspname, f.opfname)\n"
6808 " pg_catalog.string_agg(pg_catalog.format_type(oc.opcintype, NULL), ', ')\n"
6809 " FROM pg_catalog.pg_opclass oc\n"
6810 " WHERE oc.opcfamily = f.oid) \"%s\"",
6816 ",\n pg_catalog.pg_get_userbyid(f.opfowner) AS \"%s\"\n",
6819 "\nFROM pg_catalog.pg_opfamily f\n"
6820 " LEFT JOIN pg_catalog.pg_am am on am.oid = f.opfmethod\n"
6821 " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = f.opfnamespace\n");
6823 if (access_method_pattern)
6825 false,
false, NULL,
"am.amname", NULL, NULL,
6833 " FROM pg_catalog.pg_type t\n"
6834 " JOIN pg_catalog.pg_opclass oc ON oc.opcintype = t.oid\n"
6835 " LEFT JOIN pg_catalog.pg_namespace tn ON tn.oid = t.typnamespace\n"
6836 " WHERE oc.opcfamily = f.oid\n",
6837 have_where ?
"AND" :
"WHERE");
6840 "tn.nspname",
"t.typname",
6841 "pg_catalog.format_type(t.oid, NULL)",
6842 "pg_catalog.pg_type_is_visible(t.oid)",
6854 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 6975 of file describe.c.
6981 bool have_where =
false;
6982 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
6988 " am.amname AS \"%s\",\n"
6990 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6991 " THEN pg_catalog.format('%%I', of.opfname)\n"
6992 " ELSE pg_catalog.format('%%I.%%I', ns.nspname, of.opfname)\n"
6994 " pg_catalog.format_type(ap.amproclefttype, NULL) AS \"%s\",\n"
6995 " pg_catalog.format_type(ap.amprocrighttype, NULL) AS \"%s\",\n"
6996 " ap.amprocnum AS \"%s\"\n",
7005 ", p.proname AS \"%s\"\n",
7009 ", ap.amproc::pg_catalog.regprocedure AS \"%s\"\n",
7013 "FROM pg_catalog.pg_amproc ap\n"
7014 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = ap.amprocfamily\n"
7015 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod\n"
7016 " LEFT JOIN pg_catalog.pg_namespace ns ON of.opfnamespace = ns.oid\n"
7017 " LEFT JOIN pg_catalog.pg_proc p ON ap.amproc = p.oid\n");
7019 if (access_method_pattern)
7022 false,
false, NULL,
"am.amname",
7030 "ns.nspname",
"of.opfname", NULL, NULL,
7036 " ap.amproclefttype = ap.amprocrighttype DESC,\n"
7044 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 6877 of file describe.c.
6883 bool have_where =
false;
6885 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false};
6891 " am.amname AS \"%s\",\n"
6893 " WHEN pg_catalog.pg_opfamily_is_visible(of.oid)\n"
6894 " THEN pg_catalog.format('%%I', of.opfname)\n"
6895 " ELSE pg_catalog.format('%%I.%%I', nsf.nspname, of.opfname)\n"
6897 " o.amopopr::pg_catalog.regoperator AS \"%s\"\n,"
6898 " o.amopstrategy AS \"%s\",\n"
6899 " CASE o.amoppurpose\n"
6900 " WHEN 'o' THEN '%s'\n"
6901 " WHEN 's' THEN '%s'\n"
6913 ", ofs.opfname AS \"%s\"\n",
6916 "FROM pg_catalog.pg_amop o\n"
6917 " LEFT JOIN pg_catalog.pg_opfamily of ON of.oid = o.amopfamily\n"
6918 " LEFT JOIN pg_catalog.pg_am am ON am.oid = of.opfmethod AND am.oid = o.amopmethod\n"
6919 " LEFT JOIN pg_catalog.pg_namespace nsf ON of.opfnamespace = nsf.oid\n");
6922 " LEFT JOIN pg_catalog.pg_opfamily ofs ON ofs.oid = o.amopsortfamily\n");
6924 if (access_method_pattern)
6927 false,
false, NULL,
"am.amname",
6936 "nsf.nspname",
"of.opfname", NULL, NULL,
6942 " o.amoplefttype = o.amoprighttype DESC,\n"
6943 " pg_catalog.format_type(o.amoplefttype, NULL),\n"
6944 " pg_catalog.format_type(o.amoprighttype, NULL),\n"
6945 " o.amopstrategy;");
6952 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 4107 of file describe.c.
4109 bool showTables = strchr(reltypes,
't') != NULL;
4110 bool showIndexes = strchr(reltypes,
'i') != NULL;
4111 bool showNested = strchr(reltypes,
'n') != NULL;
4116 bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
false};
4117 const char *tabletitle;
4118 bool mixed_output =
false;
4127 pg_log_error(
"The server (version %s) does not support declarative table partitioning.",
4129 sverbuf,
sizeof(sverbuf)));
4134 if (!showTables && !showIndexes)
4135 showTables = showIndexes =
true;
4137 if (showIndexes && !showTables)
4138 tabletitle =
_(
"List of partitioned indexes");
4139 else if (showTables && !showIndexes)
4140 tabletitle =
_(
"List of partitioned tables");
4144 tabletitle =
_(
"List of partitioned relations");
4145 mixed_output =
true;
4151 "SELECT n.nspname as \"%s\",\n"
4152 " c.relname as \"%s\",\n"
4153 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
4161 ",\n CASE c.relkind"
4162 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
4163 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
4169 translate_columns[3] =
true;
4172 if (showNested || pattern)
4174 ",\n inh.inhparent::pg_catalog.regclass as \"%s\"",
4179 ",\n c2.oid::pg_catalog.regclass as \"%s\"",
4194 ",\n s.dps as \"%s\"",
4197 ",\n s.tps as \"%s\"",
4203 ",\n s.tps as \"%s\"",
4207 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4212 "\nFROM pg_catalog.pg_class c"
4213 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4217 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4218 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4220 if (showNested || pattern)
4222 "\n LEFT JOIN pg_catalog.pg_inherits inh ON c.oid = inh.inhrelid");
4227 "\n LEFT JOIN pg_catalog.pg_am am ON c.relam = am.oid");
4232 ",\n LATERAL (WITH RECURSIVE d\n"
4233 " AS (SELECT inhrelid AS oid, 1 AS level\n"
4234 " FROM pg_catalog.pg_inherits\n"
4235 " WHERE inhparent = c.oid\n"
4237 " SELECT inhrelid, level + 1\n"
4238 " FROM pg_catalog.pg_inherits i\n"
4239 " JOIN d ON i.inhparent = d.oid)\n"
4240 " SELECT pg_catalog.pg_size_pretty(sum(pg_catalog.pg_table_size("
4241 "d.oid))) AS tps,\n"
4242 " pg_catalog.pg_size_pretty(sum("
4243 "\n CASE WHEN d.level = 1"
4244 " THEN pg_catalog.pg_table_size(d.oid) ELSE 0 END)) AS dps\n"
4251 ",\n LATERAL (SELECT pg_catalog.pg_size_pretty(sum("
4252 "\n CASE WHEN ppt.isleaf AND ppt.level = 1"
4253 "\n THEN pg_catalog.pg_table_size(ppt.relid)"
4254 " ELSE 0 END)) AS dps"
4255 ",\n pg_catalog.pg_size_pretty(sum("
4256 "pg_catalog.pg_table_size(ppt.relid))) AS tps"
4257 "\n FROM pg_catalog.pg_partition_tree(c.oid) ppt) s");
4270 " AND NOT c.relispartition\n" :
"");
4274 " AND n.nspname !~ '^pg_toast'\n"
4275 " AND n.nspname <> 'information_schema'\n");
4278 "n.nspname",
"c.relname", NULL,
4279 "pg_catalog.pg_table_is_visible(c.oid)",
4287 mixed_output ?
"\"Type\" DESC, " :
"",
4288 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 6227 of file describe.c.
6232 static const bool translate_columns[] = {
false,
false,
false,
false,
false,
false,
false,
false};
6238 pg_log_error(
"The server (version %s) does not support publications.",
6240 sverbuf,
sizeof(sverbuf)));
6247 "SELECT pubname AS \"%s\",\n"
6248 " pg_catalog.pg_get_userbyid(pubowner) AS \"%s\",\n"
6249 " puballtables AS \"%s\",\n"
6250 " pubinsert AS \"%s\",\n"
6251 " pubupdate AS \"%s\",\n"
6252 " pubdelete AS \"%s\"",
6261 ",\n pubtruncate AS \"%s\"",
6265 ",\n pubviaroot AS \"%s\"",
6269 "\nFROM pg_catalog.pg_publication\n");
6272 NULL,
"pubname", NULL,
6287 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 5036 of file describe.c.
5041 int pub_schema_tuples = 0;
5042 char **footers = NULL;
5046 "SELECT n.nspname AS \"%s\",\n"
5047 " pg_catalog.pg_get_userbyid(n.nspowner) AS \"%s\"",
5056 ",\n pg_catalog.obj_description(n.oid, 'pg_namespace') AS \"%s\"",
5061 "\nFROM pg_catalog.pg_namespace n\n");
5063 if (!showSystem && !pattern)
5065 "WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'\n");
5068 !showSystem && !pattern,
false,
5069 NULL,
"n.nspname", NULL,
5080 myopt.
title =
_(
"List of schemas");
5090 "FROM pg_catalog.pg_publication p\n"
5091 " JOIN pg_catalog.pg_publication_namespace pn ON p.oid = pn.pnpubid\n"
5092 " JOIN pg_catalog.pg_namespace n ON n.oid = pn.pnnspid \n"
5093 "WHERE n.nspname = '%s'\n"
5102 if (pub_schema_tuples > 0)
5109 footers = (
char **)
pg_malloc((1 + pub_schema_tuples + 1) *
sizeof(
char *));
5113 for (
i = 0;
i < pub_schema_tuples;
i++)
5121 footers[
i + 1] = NULL;
5136 char **footer = NULL;
5138 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 3909 of file describe.c.
3911 bool showTables = strchr(tabtypes,
't') != NULL;
3912 bool showIndexes = strchr(tabtypes,
'i') != NULL;
3913 bool showViews = strchr(tabtypes,
'v') != NULL;
3914 bool showMatViews = strchr(tabtypes,
'm') != NULL;
3915 bool showSeq = strchr(tabtypes,
's') != NULL;
3916 bool showForeign = strchr(tabtypes,
'E') != NULL;
3922 bool translate_columns[] = {
false,
false,
true,
false,
false,
false,
false,
false,
false};
3925 if (!(showTables || showIndexes || showViews || showMatViews || showSeq || showForeign))
3926 showTables = showViews = showMatViews = showSeq = showForeign =
true;
3931 "SELECT n.nspname as \"%s\",\n"
3932 " c.relname as \"%s\",\n"
3940 " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE)
" THEN '%s'"
3941 " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE)
" THEN '%s'"
3942 " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX)
" THEN '%s'"
3944 " pg_catalog.pg_get_userbyid(c.relowner) as \"%s\"",
3963 ",\n c2.relname as \"%s\"",
3974 ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"",
3979 translate_columns[cols_so_far] =
true;
3991 (showTables || showMatViews || showIndexes))
3993 ",\n am.amname as \"%s\"",
3997 ",\n pg_catalog.pg_size_pretty(pg_catalog.pg_table_size(c.oid)) as \"%s\""
3998 ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
4004 "\nFROM pg_catalog.pg_class c"
4005 "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
4008 (showTables || showMatViews || showIndexes))
4010 "\n LEFT JOIN pg_catalog.pg_am am ON am.oid = c.relam");
4014 "\n LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
4015 "\n LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid");
4023 if (showSystem || pattern)
4035 if (showSystem || pattern)
4043 if (!showSystem && !pattern)
4045 " AND n.nspname !~ '^pg_toast'\n"
4046 " AND n.nspname <> 'information_schema'\n");
4049 "n.nspname",
"c.relname", NULL,
4050 "pg_catalog.pg_table_is_visible(c.oid)",
4072 pg_log_error(
"Did not find any relation named \"%s\".",
4079 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 5534 of file describe.c.
5547 " n.nspname as \"%s\",\n"
5548 " c.cfgname as \"%s\",\n"
5549 " pg_catalog.obj_description(c.oid, 'pg_ts_config') as \"%s\"\n"
5550 "FROM pg_catalog.pg_ts_config c\n"
5551 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.cfgnamespace\n",
5558 "n.nspname",
"c.cfgname", NULL,
5559 "pg_catalog.pg_ts_config_is_visible(c.oid)",
5573 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 5404 of file describe.c.
5414 " n.nspname as \"%s\",\n"
5415 " d.dictname as \"%s\",\n",
5422 " ( SELECT COALESCE(nt.nspname, '(null)')::pg_catalog.text || '.' || t.tmplname FROM\n"
5423 " pg_catalog.pg_ts_template t\n"
5424 " LEFT JOIN pg_catalog.pg_namespace nt ON nt.oid = t.tmplnamespace\n"
5425 " WHERE d.dicttemplate = t.oid ) AS \"%s\",\n"
5426 " d.dictinitoption as \"%s\",\n",
5432 " pg_catalog.obj_description(d.oid, 'pg_ts_dict') as \"%s\"\n",
5436 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = d.dictnamespace\n");
5439 "n.nspname",
"d.dictname", NULL,
5440 "pg_catalog.pg_ts_dict_is_visible(d.oid)",
5454 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 5157 of file describe.c.
5170 " n.nspname as \"%s\",\n"
5171 " p.prsname as \"%s\",\n"
5172 " pg_catalog.obj_description(p.oid, 'pg_ts_parser') as \"%s\"\n"
5173 "FROM pg_catalog.pg_ts_parser p\n"
5174 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.prsnamespace\n",
5181 "n.nspname",
"p.prsname", NULL,
5182 "pg_catalog.pg_ts_parser_is_visible(p.oid)",
5196 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 5469 of file describe.c.
5480 " n.nspname AS \"%s\",\n"
5481 " t.tmplname AS \"%s\",\n"
5482 " t.tmplinit::pg_catalog.regproc AS \"%s\",\n"
5483 " t.tmpllexize::pg_catalog.regproc AS \"%s\",\n"
5484 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5493 " n.nspname AS \"%s\",\n"
5494 " t.tmplname AS \"%s\",\n"
5495 " pg_catalog.obj_description(t.oid, 'pg_ts_template') AS \"%s\"\n",
5501 "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.tmplnamespace\n");
5504 "n.nspname",
"t.tmplname", NULL,
5505 "pg_catalog.pg_ts_template_is_visible(t.oid)",
5519 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 5885 of file describe.c.
5893 "SELECT um.srvname AS \"%s\",\n"
5894 " um.usename AS \"%s\"",
5900 ",\n CASE WHEN umoptions IS NULL THEN '' ELSE "
5901 " '(' || pg_catalog.array_to_string(ARRAY(SELECT "
5902 " pg_catalog.quote_ident(option_name) || ' ' || "
5903 " pg_catalog.quote_literal(option_value) FROM "
5904 " pg_catalog.pg_options_to_table(umoptions)), ', ') || ')' "
5911 NULL,
"um.srvname",
"um.usename", NULL,
5925 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().