Add documentation for new \d*S* patch, and clean up some of the docs.

Fix \do and trigger display for the patch too.
This commit is contained in:
Bruce Momjian 2009-01-06 23:01:57 +00:00
parent 9491c82f71
commit f5ed2ee533
3 changed files with 76 additions and 69 deletions

View File

@ -1,5 +1,5 @@
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.214 2008/12/19 16:25:16 petere Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.215 2009/01/06 23:01:57 momjian Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
@ -815,8 +815,7 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\d [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\d[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\d+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
@ -834,6 +833,8 @@ testdb=&gt;
more information is displayed: any comments associated with the more information is displayed: any comments associated with the
columns of the table are shown, as is the presence of OIDs in the columns of the table are shown, as is the presence of OIDs in the
table. table.
The letter <literal>S</literal> restricts the listing to system objects; without
<literal>S</literal>, only non-system objects are shown.
</para> </para>
<note> <note>
@ -849,7 +850,7 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\da [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\da[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
@ -857,14 +858,16 @@ testdb=&gt;
return type and the data types they operate on. If <replaceable return type and the data types they operate on. If <replaceable
class="parameter">pattern</replaceable> class="parameter">pattern</replaceable>
is specified, only aggregates whose names match the pattern are shown. is specified, only aggregates whose names match the pattern are shown.
The letter <literal>S</literal> restricts the listing
to system objects; without <literal>S</literal>, only
non-system objects are shown.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\db [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\db[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\db+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
@ -879,13 +882,15 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dc [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dc[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists all available conversions between character-set encodings. Lists all available conversions between character-set encodings.
If <replaceable class="parameter">pattern</replaceable> If <replaceable class="parameter">pattern</replaceable>
is specified, only conversions whose names match the pattern are is specified, only conversions whose names match the pattern are
listed. listed.
The letter <literal>S</literal> restricts the listing to system objects; without
<literal>S</literal>, only non-system objects are shown.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -905,13 +910,15 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dd [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dd[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Shows the descriptions of objects matching the <replaceable Shows the descriptions of objects matching the <replaceable
class="parameter">pattern</replaceable>, or of all visible objects if class="parameter">pattern</replaceable>, or of all visible objects if
no argument is given. But in either case, only objects that have no argument is given. But in either case, only objects that have
a description are listed. a description are listed.
The letter <literal>S</literal> restricts the listing to system objects; without
<literal>S</literal>, only non-system objects are shown.
(<quote>Object</quote> covers aggregates, functions, operators, (<quote>Object</quote> covers aggregates, functions, operators,
types, relations (tables, views, indexes, sequences, large types, relations (tables, views, indexes, sequences, large
objects), rules, and triggers.) For example: objects), rules, and triggers.) For example:
@ -935,20 +942,21 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dD [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dD[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists all available domains. If <replaceable Lists all available domains. If <replaceable
class="parameter">pattern</replaceable> class="parameter">pattern</replaceable>
is specified, only matching domains are shown. is specified, only matching domains are shown.
The letter <literal>S</literal> restricts the listing to system objects; without
<literal>S</literal>, only non-system objects are shown.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\des [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\des[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\des+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists all foreign servers (mnemonic: <quote>external Lists all foreign servers (mnemonic: <quote>external
@ -964,8 +972,7 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\deu [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\deu[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\deu+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists all user mappings (mnemonic: <quote>external Lists all user mappings (mnemonic: <quote>external
@ -988,8 +995,7 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dew [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dew[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dew+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists all foreign-data wrappers (mnemonic: <quote>external Lists all foreign-data wrappers (mnemonic: <quote>external
@ -1005,8 +1011,7 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\df [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\df[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\df+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
@ -1016,6 +1021,8 @@ testdb=&gt;
is specified, only functions whose names match the pattern are shown. is specified, only functions whose names match the pattern are shown.
If the form <literal>\df+</literal> is used, additional information about If the form <literal>\df+</literal> is used, additional information about
each function, including volatility, language, source code and description, is shown. each function, including volatility, language, source code and description, is shown.
The letter <literal>S</literal> restricts the listing to system objects; without
<literal>S</literal>, only non-system objects are shown.
</para> </para>
<note> <note>
@ -1037,8 +1044,7 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dF [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dF[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dF+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists available text search configurations. Lists available text search configurations.
@ -1052,8 +1058,7 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\dFd [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dFd[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dFd+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists available text search dictionaries. Lists available text search dictionaries.
@ -1067,8 +1072,7 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\dFp [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dFp[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dFp+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists available text search parsers. Lists available text search parsers.
@ -1082,8 +1086,7 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\dFt [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dFt[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dFt+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists available text search templates. Lists available text search templates.
@ -1110,7 +1113,7 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\distvS [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\distv[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
@ -1120,11 +1123,12 @@ testdb=&gt;
<literal>S</literal> stand for index, sequence, table, view, <literal>S</literal> stand for index, sequence, table, view,
and system table, respectively. You can specify any or all of and system table, respectively. You can specify any or all of
these letters, in any order, to obtain a listing of all the these letters, in any order, to obtain a listing of all the
matching objects. The letter <literal>S</literal> restricts matching objects. If <literal>+</literal> is
the listing to system objects; without <literal>S</literal>,
only non-system objects are shown. If <literal>+</literal> is
appended to the command name, each object is listed with its appended to the command name, each object is listed with its
physical size on disk and its associated description, if any. physical size on disk and its associated description, if any.
The letter <literal>S</literal> restricts the listing
to system objects; without <literal>S</literal>, only
non-system objects are shown.
</para> </para>
<para> <para>
@ -1147,8 +1151,7 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dn [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dn[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dn+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
@ -1164,12 +1167,15 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\do [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\do[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists available operators with their operand and return types. Lists available operators with their operand and return types.
If <replaceable class="parameter">pattern</replaceable> is If <replaceable class="parameter">pattern</replaceable> is
specified, only operators whose names match the pattern are listed. specified, only operators whose names match the pattern are listed.
The letter <literal>S</literal> restricts the listing
to system objects; without <literal>S</literal>, only
non-system objects are shown.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -1195,14 +1201,15 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\dT [ <replaceable class="parameter">pattern</replaceable> ]</literal></term> <term><literal>\dT[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dT+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists all data types or only those that match <replaceable Lists all data types or only those that match <replaceable
class="parameter">pattern</replaceable>. The command form class="parameter">pattern</replaceable>. The command form
<literal>\dT+</literal> shows extra information, namely the type's internal name, size, and <literal>\dT+</literal> shows extra information, namely the type's internal name, size, and
allowed values for <type>enum</> types. allowed values for <type>enum</> types.
The letter <literal>S</literal> restricts the listing to system objects; without
<literal>S</literal>, only non-system objects are shown.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -8,7 +8,7 @@
* *
* Copyright (c) 2000-2009, PostgreSQL Global Development Group * Copyright (c) 2000-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.194 2009/01/06 21:10:30 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.195 2009/01/06 23:01:57 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
@ -428,7 +428,7 @@ describeOperators(const char *pattern, bool showSystem)
gettext_noop("Description")); gettext_noop("Description"));
if (!showSystem) if (!showSystem)
appendPQExpBuffer(&buf, " AND n.nspname <> 'pg_catalog'\n"); appendPQExpBuffer(&buf, " WHERE n.nspname <> 'pg_catalog'\n");
processSQLNamePattern(pset.db, &buf, pattern, !showSystem, true, processSQLNamePattern(pset.db, &buf, pattern, !showSystem, true,
"n.nspname", "o.oprname", NULL, "n.nspname", "o.oprname", NULL,
@ -743,7 +743,7 @@ objectDescription(const char *pattern, bool showSystem)
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n", " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
gettext_noop("trigger")); gettext_noop("trigger"));
if (!showSystem) if (!showSystem)
appendPQExpBuffer(&buf, " AND n.nspname <> 'pg_catalog'\n"); appendPQExpBuffer(&buf, " WHERE n.nspname <> 'pg_catalog'\n");
/* XXX not sure what to do about visibility rule here? */ /* XXX not sure what to do about visibility rule here? */
processSQLNamePattern(pset.db, &buf, pattern, !showSystem, false, processSQLNamePattern(pset.db, &buf, pattern, !showSystem, false,

View File

@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2009, PostgreSQL Global Development Group * Copyright (c) 2000-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.134 2009/01/06 21:10:30 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.135 2009/01/06 23:01:57 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
@ -196,35 +196,35 @@ slashUsage(unsigned short int pager)
fprintf(output, _("Informational\n")); fprintf(output, _("Informational\n"));
fprintf(output, _(" Modifiers: S = show system objects + = Additional detail\n")); fprintf(output, _(" Modifiers: S = show system objects + = Additional detail\n"));
fprintf(output, _(" \\l[+] list all databases\n")); fprintf(output, _(" \\l[+] list all databases\n"));
fprintf(output, _(" \\d[S] list tables, views, and sequences\n")); fprintf(output, _(" \\d[S+] list tables, views, and sequences\n"));
fprintf(output, _(" \\d[S] NAME describe table, view, sequence, or index\n")); fprintf(output, _(" \\d[S+] NAME describe table, view, sequence, or index\n"));
fprintf(output, _(" \\dt[S+] [PATTERN] list tables\n")); fprintf(output, _(" \\da[S] [PATTERN] list aggregate functions\n"));
fprintf(output, _(" \\dv[S+] [PATTERN] list views\n")); fprintf(output, _(" \\db[+] [PATTERN] list tablespaces\n"));
fprintf(output, _(" \\ds[S+] [PATTERN] list sequences\n")); fprintf(output, _(" \\dc[S] [PATTERN] list conversions\n"));
fprintf(output, _(" \\di[S+] [PATTERN] list indexes\n")); fprintf(output, _(" \\dC [PATTERN] list casts\n"));
fprintf(output, _(" \\df[S+] [PATTERN] list functions\n")); fprintf(output, _(" \\dd [PATTERN] show comment for object\n"));
fprintf(output, _(" \\dT[S+] [PATTERN] list data types\n"));
fprintf(output, _(" \\dd[S] [PATTERN] list comments on objects\n")); fprintf(output, _(" \\dd[S] [PATTERN] list comments on objects\n"));
fprintf(output, _(" \\dD[S] [PATTERN] list domains\n")); fprintf(output, _(" \\dD[S] [PATTERN] list domains\n"));
fprintf(output, _(" \\des[+] [PATTERN] list foreign servers\n")); fprintf(output, _(" \\des[+] [PATTERN] list foreign servers\n"));
fprintf(output, _(" \\deu[+] [PATTERN] list user mappings\n")); fprintf(output, _(" \\deu[+] [PATTERN] list user mappings\n"));
fprintf(output, _(" \\dew[+] [PATTERN] list foreign-data wrappers\n")); fprintf(output, _(" \\dew[+] [PATTERN] list foreign-data wrappers\n"));
fprintf(output, _(" \\do[S] [PATTERN] list operators\n")); fprintf(output, _(" \\df[S+] [PATTERN] list functions\n"));
fprintf(output, _(" \\da[S] [PATTERN] list aggregate functions\n"));
fprintf(output, _(" \\dc[S] [PATTERN] list conversions\n"));
fprintf(output, _(" \\db[+] [PATTERN] list tablespaces\n"));
fprintf(output, _(" \\dn[+] [PATTERN] list schemas\n"));
fprintf(output, _(" \\dC list casts\n"));
fprintf(output, _(" \\dd [PATTERN] show comment for object\n"));
fprintf(output, _(" \\dF[+] [PATTERN] list text search configurations\n")); fprintf(output, _(" \\dF[+] [PATTERN] list text search configurations\n"));
fprintf(output, _(" \\dFd[+] [PATTERN] list text search dictionaries\n")); fprintf(output, _(" \\dFd[+] [PATTERN] list text search dictionaries\n"));
fprintf(output, _(" \\dFt [PATTERN] list text search templates\n"));
fprintf(output, _(" \\dFp[+] [PATTERN] list text search parsers\n")); fprintf(output, _(" \\dFp[+] [PATTERN] list text search parsers\n"));
fprintf(output, _(" \\dFt[+] [PATTERN] list text search templates\n"));
fprintf(output, _(" \\dg [PATTERN] list roles (groups)\n")); fprintf(output, _(" \\dg [PATTERN] list roles (groups)\n"));
fprintf(output, _(" \\di[S+] [PATTERN] list indexes\n"));
fprintf(output, _(" \\dl list large objects, same as \\lo_list\n")); fprintf(output, _(" \\dl list large objects, same as \\lo_list\n"));
fprintf(output, _(" \\du [PATTERN] list roles (users)\n")); fprintf(output, _(" \\dn[+] [PATTERN] list schemas\n"));
fprintf(output, _(" \\do[S] [PATTERN] list operators\n"));
fprintf(output, _(" \\dp [PATTERN] list table, view, and sequence access privileges\n")); fprintf(output, _(" \\dp [PATTERN] list table, view, and sequence access privileges\n"));
fprintf(output, _(" \\z [PATTERN] same as \\dp\n")); fprintf(output, _(" \\z [PATTERN] same as \\dp\n"));
fprintf(output, _(" \\ds[S+] [PATTERN] list sequences\n"));
fprintf(output, _(" \\dt[S+] [PATTERN] list tables\n"));
fprintf(output, _(" \\dT[S+] [PATTERN] list data types\n"));
fprintf(output, _(" \\du [PATTERN] list roles (users)\n"));
fprintf(output, _(" \\dv[S+] [PATTERN] list views\n"));
fprintf(output, "\n"); fprintf(output, "\n");
fprintf(output, _("Formatting\n")); fprintf(output, _("Formatting\n"));