PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <ctype.h>
#include "catalog/pg_am.h"
#include "catalog/pg_attribute_d.h"
#include "catalog/pg_cast_d.h"
#include "catalog/pg_class_d.h"
#include "catalog/pg_default_acl_d.h"
#include "common.h"
#include "common/logging.h"
#include "describe.h"
#include "fe_utils/mbprint.h"
#include "fe_utils/print.h"
#include "fe_utils/string_utils.h"
#include "settings.h"
Go to the source code of this file.
Functions | |
static const char * | map_typename_pattern (const char *pattern) |
static bool | describeOneTableDetails (const char *schemaname, const char *relationname, const char *oid, bool verbose) |
static void | add_tablespace_footer (printTableContent *const cont, char relkind, Oid tablespace, const bool newline) |
static void | add_role_attribute (PQExpBuffer buf, const char *const str) |
static bool | listTSParsersVerbose (const char *pattern) |
static bool | describeOneTSParser (const char *oid, const char *nspname, const char *prsname) |
static bool | listTSConfigsVerbose (const char *pattern) |
static bool | describeOneTSConfig (const char *oid, const char *nspname, const char *cfgname, const char *pnspname, const char *prsname) |
static void | printACLColumn (PQExpBuffer buf, const char *colname) |
static bool | listOneExtensionContents (const char *extname, const char *oid) |
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) |
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 | listAllDbs (const char *pattern, bool verbose) |
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 | describeRoles (const char *pattern, bool verbose, bool showSystem) |
bool | listDbRoleSettings (const char *pattern, const char *pattern2) |
bool | describeRoleGrants (const char *pattern, bool showSystem) |
bool | listTables (const char *tabtypes, const char *pattern, bool verbose, bool showSystem) |
bool | listPartitionedTables (const char *reltypes, const char *pattern, bool verbose) |
bool | listLanguages (const char *pattern, bool verbose, bool showSystem) |
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 | listEventTriggers (const char *pattern, bool verbose) |
bool | listExtendedStats (const char *pattern) |
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 | listTSParsers (const char *pattern, bool verbose) |
bool | listTSDictionaries (const char *pattern, bool verbose) |
bool | listTSTemplates (const char *pattern, bool verbose) |
bool | listTSConfigs (const char *pattern, bool verbose) |
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 | listExtensions (const char *pattern) |
bool | listExtensionContents (const char *pattern) |
bool | listPublications (const char *pattern) |
static bool | addFooterToPublicationDesc (PQExpBuffer buf, const char *footermsg, bool as_schema, printTableContent *const cont) |
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) |
|
static |
Definition at line 3796 of file describe.c.
References appendPQExpBufferStr(), buf, and str.
Referenced by describeRoles().
|
static |
Definition at line 3596 of file describe.c.
References _, appendPQExpBuffer(), buf, printTableFooter::data, printTableContent::footer, initPQExpBuffer(), newline, PQclear(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), printTableAddFooter(), printTableSetFooter(), PSQLexec(), tablespace, and termPQExpBuffer().
Referenced by describeOneTableDetails().
|
static |
Definition at line 6354 of file describe.c.
References appendPQExpBuffer(), buf, i, PQclear(), PQgetisnull(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), printTableAddFooter(), PSQLexec(), and res.
Referenced by describePublications().
Definition at line 140 of file describe.c.
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().
Definition at line 70 of file describe.c.
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().
Definition at line 4603 of file describe.c.
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 287 of file describe.c.
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().
|
static |
Definition at line 1527 of file describe.c.
References _, add_tablespace_footer(), appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), Assert, atooid, buf, CppAsString2, StringInfoData::data, PQExpBufferData::data, printTableOpt::default_footer, _psqlSettings::encoding, printTableOpt::expanded, fmtId(), printQueryOpt::footers, free, gettext_noop, _psqlSettings::hide_compression, _psqlSettings::hide_tableam, i, initPQExpBuffer(), lengthof, _psqlSettings::logfile, pg_log_error, pg_strdup(), pg_wcswidth(), _psqlSettings::popt, PQclear(), PQfnumber(), PQgetisnull(), PQgetvalue(), PQntuples(), printfPQExpBuffer(), printQuery(), printTable(), printTableAddCell(), printTableAddFooter(), printTableAddHeader(), printTableCleanup(), printTableInit(), pset, psprintf(), PSQLexec(), _psqlSettings::queryFout, _psqlSettings::quiet, relname, res, resetPQExpBuffer(), storage, _psqlSettings::sversion, tablespace, termPQExpBuffer(), printQueryOpt::title, tmpbuf, printQueryOpt::topt, printQueryOpt::translate_header, and verbose.
Referenced by describeTableDetails().
|
static |
Definition at line 5714 of file describe.c.
References _, appendPQExpBuffer(), buf, PQExpBufferData::data, printTableOpt::default_footer, printQueryOpt::footers, gettext_noop, initPQExpBuffer(), _psqlSettings::logfile, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::topt, and printQueryOpt::translate_header.
Referenced by listTSConfigsVerbose().
|
static |
Definition at line 5331 of file describe.c.
References _, buf, PQExpBufferData::data, printTableOpt::default_footer, printQueryOpt::footers, gettext_noop, initPQExpBuffer(), lengthof, _psqlSettings::logfile, printQueryOpt::n_translate_columns, _psqlSettings::popt, PQclear(), printfPQExpBuffer(), printQuery(), pset, PSQLexec(), _psqlSettings::queryFout, res, termPQExpBuffer(), printQueryOpt::title, printQueryOpt::topt, printQueryOpt::translate_columns, and printQueryOpt::translate_header.
Referenced by listTSParsersVerbose().
bool describeOperators | ( | const char * | oper_pattern, |
char ** | arg_patterns, | ||
int | num_arg_patterns, | ||
bool | verbose, | ||
bool | showSystem | ||
) |
Definition at line 769 of file describe.c.
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 6400 of file describe.c.
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().
Definition at line 3877 of file describe.c.
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().
Definition at line 3661 of file describe.c.
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().
Definition at line 6598 of file describe.c.
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().
Definition at line 1444 of file describe.c.
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().
Definition at line 214 of file describe.c.
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 614 of file describe.c.
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().
Definition at line 910 of file describe.c.
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().
Definition at line 4847 of file describe.c.
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().
Definition at line 4965 of file describe.c.
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().
Definition at line 4523 of file describe.c.
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 3808 of file describe.c.
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 1174 of file describe.c.
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().
Definition at line 4440 of file describe.c.
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 4671 of file describe.c.