|
|
|
@@ -224,7 +224,7 @@ describeFunctions(const char *functypes, const char *pattern, bool verbose, bool
|
|
|
|
|
PQExpBufferData buf;
|
|
|
|
|
PGresult *res;
|
|
|
|
|
printQueryOpt myopt = pset.popt;
|
|
|
|
|
static const bool translate_columns[] = {false, false, false, false, true, true, false, false, false, false};
|
|
|
|
|
static const bool translate_columns[] = {false, false, false, false, true, true, true, false, false, false, false};
|
|
|
|
|
|
|
|
|
|
if (strlen(functypes) != strspn(functypes, "antwS+"))
|
|
|
|
|
{
|
|
|
|
@@ -457,6 +457,7 @@ describeFunctions(const char *functypes, const char *pattern, bool verbose, bool
|
|
|
|
|
myopt.title = _("List of functions");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -789,6 +790,7 @@ permissionsList(const char *pattern)
|
|
|
|
|
myopt.title = buf.data;
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -862,6 +864,7 @@ listDefaultACLs(const char *pattern)
|
|
|
|
|
myopt.title = buf.data;
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -1034,6 +1037,7 @@ objectDescription(const char *pattern, bool showSystem)
|
|
|
|
|
myopt.title = _("Object descriptions");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -2818,6 +2822,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
|
|
|
|
|
myopt.title = _("List of relations");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
}
|
|
|
|
@@ -2999,7 +3004,8 @@ listConversions(const char *pattern, bool verbose, bool showSystem)
|
|
|
|
|
PQExpBufferData buf;
|
|
|
|
|
PGresult *res;
|
|
|
|
|
printQueryOpt myopt = pset.popt;
|
|
|
|
|
static const bool translate_columns[] = {false, false, false, false, true};
|
|
|
|
|
static const bool translate_columns[] =
|
|
|
|
|
{false, false, false, false, true, false};
|
|
|
|
|
|
|
|
|
|
initPQExpBuffer(&buf);
|
|
|
|
|
|
|
|
|
@@ -3055,6 +3061,7 @@ listConversions(const char *pattern, bool verbose, bool showSystem)
|
|
|
|
|
myopt.title = _("List of conversions");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -3079,19 +3086,23 @@ listEventTriggers(const char *pattern, bool verbose)
|
|
|
|
|
initPQExpBuffer(&buf);
|
|
|
|
|
|
|
|
|
|
printfPQExpBuffer(&buf,
|
|
|
|
|
"select evtname as \"%s\", "
|
|
|
|
|
"SELECT evtname as \"%s\", "
|
|
|
|
|
"evtevent as \"%s\", "
|
|
|
|
|
"pg_catalog.pg_get_userbyid(e.evtowner) AS \"%s\", "
|
|
|
|
|
"case evtenabled when 'O' then 'enabled' "
|
|
|
|
|
" when 'R' then 'replica' "
|
|
|
|
|
" when 'A' then 'always' "
|
|
|
|
|
" when 'D' then 'disabled' end as \"%s\", "
|
|
|
|
|
"e.evtfoid::regproc as \"%s\", "
|
|
|
|
|
"array_to_string(array(select x "
|
|
|
|
|
" from unnest(evttags) as t(x)), ', ') as \"%s\" ",
|
|
|
|
|
"pg_catalog.pg_get_userbyid(e.evtowner) as \"%s\",\n"
|
|
|
|
|
" case evtenabled when 'O' then '%s'"
|
|
|
|
|
" when 'R' then '%s'"
|
|
|
|
|
" when 'A' then '%s'"
|
|
|
|
|
" when 'D' then '%s' end as \"%s\",\n"
|
|
|
|
|
" e.evtfoid::pg_catalog.regproc as \"%s\", "
|
|
|
|
|
"pg_catalog.array_to_string(array(select x"
|
|
|
|
|
" from pg_catalog.unnest(evttags) as t(x)), ', ') as \"%s\"",
|
|
|
|
|
gettext_noop("Name"),
|
|
|
|
|
gettext_noop("Event"),
|
|
|
|
|
gettext_noop("Owner"),
|
|
|
|
|
gettext_noop("enabled"),
|
|
|
|
|
gettext_noop("replica"),
|
|
|
|
|
gettext_noop("always"),
|
|
|
|
|
gettext_noop("disabled"),
|
|
|
|
|
gettext_noop("Enabled"),
|
|
|
|
|
gettext_noop("Procedure"),
|
|
|
|
|
gettext_noop("Tags"));
|
|
|
|
@@ -3100,7 +3111,7 @@ listEventTriggers(const char *pattern, bool verbose)
|
|
|
|
|
",\npg_catalog.obj_description(e.oid, 'pg_event_trigger') as \"%s\"",
|
|
|
|
|
gettext_noop("Description"));
|
|
|
|
|
appendPQExpBufferStr(&buf,
|
|
|
|
|
"\nFROM pg_event_trigger e ");
|
|
|
|
|
"\nFROM pg_catalog.pg_event_trigger e ");
|
|
|
|
|
|
|
|
|
|
processSQLNamePattern(pset.db, &buf, pattern, false, false,
|
|
|
|
|
NULL, "evtname", NULL, NULL);
|
|
|
|
@@ -3116,6 +3127,7 @@ listEventTriggers(const char *pattern, bool verbose)
|
|
|
|
|
myopt.title = _("List of event triggers");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -3134,7 +3146,7 @@ listCasts(const char *pattern, bool verbose)
|
|
|
|
|
PQExpBufferData buf;
|
|
|
|
|
PGresult *res;
|
|
|
|
|
printQueryOpt myopt = pset.popt;
|
|
|
|
|
static const bool translate_columns[] = {false, false, false, true};
|
|
|
|
|
static const bool translate_columns[] = {false, false, false, true, false};
|
|
|
|
|
|
|
|
|
|
initPQExpBuffer(&buf);
|
|
|
|
|
|
|
|
|
@@ -3214,6 +3226,7 @@ listCasts(const char *pattern, bool verbose)
|
|
|
|
|
myopt.title = _("List of casts");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -3289,6 +3302,7 @@ listCollations(const char *pattern, bool verbose, bool showSystem)
|
|
|
|
|
myopt.title = _("List of collations");
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -3548,6 +3562,7 @@ describeOneTSParser(const char *oid, const char *nspname, const char *prsname)
|
|
|
|
|
myopt.topt.default_footer = false;
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = translate_columns;
|
|
|
|
|
myopt.n_translate_columns = lengthof(translate_columns);
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
@@ -3579,6 +3594,7 @@ describeOneTSParser(const char *oid, const char *nspname, const char *prsname)
|
|
|
|
|
myopt.topt.default_footer = true;
|
|
|
|
|
myopt.translate_header = true;
|
|
|
|
|
myopt.translate_columns = NULL;
|
|
|
|
|
myopt.n_translate_columns = 0;
|
|
|
|
|
|
|
|
|
|
printQuery(res, &myopt, pset.queryFout, pset.logfile);
|
|
|
|
|
|
|
|
|
|