Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5ed2ee

Browse files
committed
Add documentation for new \d*S* patch, and clean up some of the docs.
Fix \do and trigger display for the patch too.
1 parent9491c82 commitf5ed2ee

File tree

3 files changed

+76
-69
lines changed

3 files changed

+76
-69
lines changed

‎doc/src/sgml/ref/psql-ref.sgml

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.214 2008/12/19 16:25:16 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.215 2009/01/06 23:01:57 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -815,8 +815,7 @@ testdb=&gt;
815815
</varlistentry>
816816

817817
<varlistentry>
818-
<term><literal>\d [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
819-
<term><literal>\d+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
818+
<term><literal>\d[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
820819

821820
<listitem>
822821
<para>
@@ -834,6 +833,8 @@ testdb=&gt;
834833
more information is displayed: any comments associated with the
835834
columns of the table are shown, as is the presence of OIDs in the
836835
table.
836+
The letter <literal>S</literal> restricts the listing to system objects; without
837+
<literal>S</literal>, only non-system objects are shown.
837838
</para>
838839

839840
<note>
@@ -849,22 +850,24 @@ testdb=&gt;
849850
</varlistentry>
850851

851852
<varlistentry>
852-
<term><literal>\da [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
853+
<term><literal>\da[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
853854

854855
<listitem>
855856
<para>
856857
Lists all available aggregate functions, together with their
857858
return type and the data types they operate on. If <replaceable
858859
class="parameter">pattern</replaceable>
859860
is specified, only aggregates whose names match the pattern are shown.
861+
The letter <literal>S</literal> restricts the listing
862+
to system objects; without <literal>S</literal>, only
863+
non-system objects are shown.
860864
</para>
861865
</listitem>
862866
</varlistentry>
863867

864868

865869
<varlistentry>
866-
<term><literal>\db [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
867-
<term><literal>\db+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
870+
<term><literal>\db[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
868871

869872
<listitem>
870873
<para>
@@ -879,13 +882,15 @@ testdb=&gt;
879882

880883

881884
<varlistentry>
882-
<term><literal>\dc [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
885+
<term><literal>\dc[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
883886
<listitem>
884887
<para>
885888
Lists all available conversions between character-set encodings.
886889
If <replaceable class="parameter">pattern</replaceable>
887890
is specified, only conversions whose names match the pattern are
888891
listed.
892+
The letter <literal>S</literal> restricts the listing to system objects; without
893+
<literal>S</literal>, only non-system objects are shown.
889894
</para>
890895
</listitem>
891896
</varlistentry>
@@ -905,13 +910,15 @@ testdb=&gt;
905910

906911

907912
<varlistentry>
908-
<term><literal>\dd [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
913+
<term><literal>\dd[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
909914
<listitem>
910915
<para>
911916
Shows the descriptions of objects matching the <replaceable
912917
class="parameter">pattern</replaceable>, or of all visible objects if
913918
no argument is given. But in either case, only objects that have
914919
a description are listed.
920+
The letter <literal>S</literal> restricts the listing to system objects; without
921+
<literal>S</literal>, only non-system objects are shown.
915922
(<quote>Object</quote> covers aggregates, functions, operators,
916923
types, relations (tables, views, indexes, sequences, large
917924
objects), rules, and triggers.) For example:
@@ -935,20 +942,21 @@ testdb=&gt;
935942

936943

937944
<varlistentry>
938-
<term><literal>\dD [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
945+
<term><literal>\dD[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
939946
<listitem>
940947
<para>
941948
Lists all available domains. If <replaceable
942949
class="parameter">pattern</replaceable>
943950
is specified, only matching domains are shown.
951+
The letter <literal>S</literal> restricts the listing to system objects; without
952+
<literal>S</literal>, only non-system objects are shown.
944953
</para>
945954
</listitem>
946955
</varlistentry>
947956

948957

949958
<varlistentry>
950-
<term><literal>\des [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
951-
<term><literal>\des+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
959+
<term><literal>\des[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
952960
<listitem>
953961
<para>
954962
Lists all foreign servers (mnemonic: <quote>external
@@ -964,8 +972,7 @@ testdb=&gt;
964972

965973

966974
<varlistentry>
967-
<term><literal>\deu [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
968-
<term><literal>\deu+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
975+
<term><literal>\deu[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
969976
<listitem>
970977
<para>
971978
Lists all user mappings (mnemonic: <quote>external
@@ -988,8 +995,7 @@ testdb=&gt;
988995

989996

990997
<varlistentry>
991-
<term><literal>\dew [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
992-
<term><literal>\dew+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
998+
<term><literal>\dew[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
993999
<listitem>
9941000
<para>
9951001
Lists all foreign-data wrappers (mnemonic: <quote>external
@@ -1005,8 +1011,7 @@ testdb=&gt;
10051011

10061012

10071013
<varlistentry>
1008-
<term><literal>\df [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1009-
<term><literal>\df+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1014+
<term><literal>\df[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
10101015

10111016
<listitem>
10121017
<para>
@@ -1016,6 +1021,8 @@ testdb=&gt;
10161021
is specified, only functions whose names match the pattern are shown.
10171022
If the form <literal>\df+</literal> is used, additional information about
10181023
each function, including volatility, language, source code and description, is shown.
1024+
The letter <literal>S</literal> restricts the listing to system objects; without
1025+
<literal>S</literal>, only non-system objects are shown.
10191026
</para>
10201027

10211028
<note>
@@ -1037,8 +1044,7 @@ testdb=&gt;
10371044

10381045

10391046
<varlistentry>
1040-
<term><literal>\dF [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1041-
<term><literal>\dF+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1047+
<term><literal>\dF[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
10421048
<listitem>
10431049
<para>
10441050
Lists available text search configurations.
@@ -1052,8 +1058,7 @@ testdb=&gt;
10521058
</varlistentry>
10531059

10541060
<varlistentry>
1055-
<term><literal>\dFd [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1056-
<term><literal>\dFd+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1061+
<term><literal>\dFd[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
10571062
<listitem>
10581063
<para>
10591064
Lists available text search dictionaries.
@@ -1067,8 +1072,7 @@ testdb=&gt;
10671072
</varlistentry>
10681073

10691074
<varlistentry>
1070-
<term><literal>\dFp [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1071-
<term><literal>\dFp+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1075+
<term><literal>\dFp[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
10721076
<listitem>
10731077
<para>
10741078
Lists available text search parsers.
@@ -1082,8 +1086,7 @@ testdb=&gt;
10821086
</varlistentry>
10831087

10841088
<varlistentry>
1085-
<term><literal>\dFt [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1086-
<term><literal>\dFt+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1089+
<term><literal>\dFt[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
10871090
<listitem>
10881091
<para>
10891092
Lists available text search templates.
@@ -1110,7 +1113,7 @@ testdb=&gt;
11101113

11111114

11121115
<varlistentry>
1113-
<term><literal>\distvS [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1116+
<term><literal>\distv[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
11141117

11151118
<listitem>
11161119
<para>
@@ -1120,11 +1123,12 @@ testdb=&gt;
11201123
<literal>S</literal> stand for index, sequence, table, view,
11211124
and system table, respectively. You can specify any or all of
11221125
these letters, in any order, to obtain a listing of all the
1123-
matching objects. The letter <literal>S</literal> restricts
1124-
the listing to system objects; without <literal>S</literal>,
1125-
only non-system objects are shown. If <literal>+</literal> is
1126+
matching objects. If <literal>+</literal> is
11261127
appended to the command name, each object is listed with its
11271128
physical size on disk and its associated description, if any.
1129+
The letter <literal>S</literal> restricts the listing
1130+
to system objects; without <literal>S</literal>, only
1131+
non-system objects are shown.
11281132
</para>
11291133

11301134
<para>
@@ -1147,8 +1151,7 @@ testdb=&gt;
11471151

11481152

11491153
<varlistentry>
1150-
<term><literal>\dn [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1151-
<term><literal>\dn+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1154+
<term><literal>\dn[+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
11521155

11531156
<listitem>
11541157
<para>
@@ -1164,12 +1167,15 @@ testdb=&gt;
11641167

11651168

11661169
<varlistentry>
1167-
<term><literal>\do [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1170+
<term><literal>\do[S] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
11681171
<listitem>
11691172
<para>
11701173
Lists available operators with their operand and return types.
11711174
If <replaceable class="parameter">pattern</replaceable> is
11721175
specified, only operators whose names match the pattern are listed.
1176+
The letter <literal>S</literal> restricts the listing
1177+
to system objects; without <literal>S</literal>, only
1178+
non-system objects are shown.
11731179
</para>
11741180
</listitem>
11751181
</varlistentry>
@@ -1195,14 +1201,15 @@ testdb=&gt;
11951201

11961202

11971203
<varlistentry>
1198-
<term><literal>\dT [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1199-
<term><literal>\dT+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
1204+
<term><literal>\dT[S+] [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
12001205
<listitem>
12011206
<para>
12021207
Lists all data types or only those that match <replaceable
12031208
class="parameter">pattern</replaceable>. The command form
12041209
<literal>\dT+</literal> shows extra information, namely the type's internal name, size, and
12051210
allowed values for <type>enum</> types.
1211+
The letter <literal>S</literal> restricts the listing to system objects; without
1212+
<literal>S</literal>, only non-system objects are shown.
12061213
</para>
12071214
</listitem>
12081215
</varlistentry>

‎src/bin/psql/describe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
1010
*
11-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.194 2009/01/0621:10:30 momjian Exp $
11+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.195 2009/01/0623:01:57 momjian Exp $
1212
*/
1313
#include"postgres_fe.h"
1414

@@ -428,7 +428,7 @@ describeOperators(const char *pattern, bool showSystem)
428428
gettext_noop("Description"));
429429

430430
if (!showSystem)
431-
appendPQExpBuffer(&buf,"AND n.nspname <> 'pg_catalog'\n");
431+
appendPQExpBuffer(&buf,"WHERE n.nspname <> 'pg_catalog'\n");
432432

433433
processSQLNamePattern(pset.db,&buf,pattern, !showSystem, true,
434434
"n.nspname","o.oprname",NULL,
@@ -743,7 +743,7 @@ objectDescription(const char *pattern, bool showSystem)
743743
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
744744
gettext_noop("trigger"));
745745
if (!showSystem)
746-
appendPQExpBuffer(&buf,"AND n.nspname <> 'pg_catalog'\n");
746+
appendPQExpBuffer(&buf,"WHERE n.nspname <> 'pg_catalog'\n");
747747

748748
/* XXX not sure what to do about visibility rule here? */
749749
processSQLNamePattern(pset.db,&buf,pattern, !showSystem, false,

‎src/bin/psql/help.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.134 2009/01/0621:10:30 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.135 2009/01/0623:01:57 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -194,37 +194,37 @@ slashUsage(unsigned short int pager)
194194
fprintf(output,"\n");
195195

196196
fprintf(output,_("Informational\n"));
197-
fprintf(output,_(" Modifiers: S = show system objects + = Additional detail\n"));
198-
fprintf(output,_(" \\l[+] list all databases\n"));
199-
fprintf(output,_(" \\d[S] list tables, views, and sequences\n"));
200-
fprintf(output,_(" \\d[S] NAME describe table, view, sequence, or index\n"));
201-
fprintf(output,_(" \\dt[S+] [PATTERN] listtables\n"));
202-
fprintf(output,_(" \\dv[S+] [PATTERN] listviews\n"));
203-
fprintf(output,_(" \\ds[S+] [PATTERN] listsequences\n"));
204-
fprintf(output,_(" \\di[S+] [PATTERN] listindexes\n"));
205-
fprintf(output,_(" \\df[S+] [PATTERN]list functions\n"));
206-
fprintf(output,_(" \\dT[S+] [PATTERN] listdata types\n"));
207-
fprintf(output,_(" \\dd[S] [PATTERN]list comments on objects\n"));
208-
fprintf(output,_(" \\dD[S] [PATTERN] listdomains\n"));
209-
fprintf(output,_(" \\des[+] [PATTERN] listforeign servers\n"));
210-
fprintf(output,_(" \\deu[+] [PATTERN] listuser mappings\n"));
211-
fprintf(output,_(" \\dew[+] [PATTERN]list foreign-data wrappers\n"));
212-
fprintf(output,_(" \\do[S] [PATTERN] listoperators\n"));
213-
fprintf(output,_(" \\da[S] [PATTERN] listaggregate functions\n"));
214-
fprintf(output,_(" \\dc[S] [PATTERN] listconversions\n"));
215-
fprintf(output,_(" \\db[+] [PATTERN] listtablespaces\n"));
216-
fprintf(output,_(" \\dn[+] [PATTERN] listschemas\n"));
217-
fprintf(output,_(" \\dClistcasts\n"));
218-
fprintf(output,_(" \\dd [PATTERN]show comment for object\n"));
219-
fprintf(output,_(" \\dF[+] [PATTERN]list text search configurations\n"));
220-
fprintf(output,_(" \\dFd[+] [PATTERN]list text search dictionaries\n"));
221-
fprintf(output,_(" \\dFt [PATTERN] listtext search templates\n"));
222-
fprintf(output,_("\\dFp[+] [PATTERN]list text search parsers\n"));
223-
fprintf(output,_(" \\dg [PATTERN]listroles (groups)\n"));
224-
fprintf(output,_(" \\dllistlarge objects, same as \\lo_list\n"));
225-
fprintf(output,_(" \\du [PATTERN]listroles (users)\n"));
226-
fprintf(output,_(" \\dp [PATTERN]list table, view, and sequence access privileges\n"));
227-
fprintf(output,_(" \\z [PATTERN] same as \\dp\n"));
197+
fprintf(output,_(" Modifiers: S = show system objects + = Additional detail\n"));
198+
fprintf(output,_(" \\l[+] list all databases\n"));
199+
fprintf(output,_(" \\d[S+] list tables, views, and sequences\n"));
200+
fprintf(output,_(" \\d[S+] NAME describe table, view, sequence, or index\n"));
201+
fprintf(output,_(" \\da[S] [PATTERN]listaggregate functions\n"));
202+
fprintf(output,_(" \\db[+] [PATTERN]listtablespaces\n"));
203+
fprintf(output,_(" \\dc[S] [PATTERN]listconversions\n"));
204+
fprintf(output,_(" \\dC [PATTERN]listcasts\n"));
205+
fprintf(output,_(" \\dd [PATTERN] show comment for object\n"));
206+
fprintf(output,_(" \\dd[S] [PATTERN]listcomments on objects\n"));
207+
fprintf(output,_(" \\dD[S] [PATTERN] list domains\n"));
208+
fprintf(output,_(" \\des[+] [PATTERN]listforeign servers\n"));
209+
fprintf(output,_(" \\deu[+] [PATTERN]listuser mappings\n"));
210+
fprintf(output,_(" \\dew[+] [PATTERN]listforeign-data wrappers\n"));
211+
fprintf(output,_(" \\df[S+] [PATTERN] list functions\n"));
212+
fprintf(output,_(" \\dF[+] [PATTERN]listtext search configurations\n"));
213+
fprintf(output,_(" \\dFd[+] [PATTERN]listtext search dictionaries\n"));
214+
fprintf(output,_(" \\dFp[+] [PATTERN]listtext search parsers\n"));
215+
fprintf(output,_(" \\dFt[+] [PATTERN]listtext search templates\n"));
216+
fprintf(output,_(" \\dg [PATTERN]listroles (groups)\n"));
217+
fprintf(output,_(" \\di[S+] [PATTERN] listindexes\n"));
218+
fprintf(output,_(" \\dl list large objects, same as \\lo_list\n"));
219+
fprintf(output,_(" \\dn[+] [PATTERN] list schemas\n"));
220+
fprintf(output,_(" \\do[S] [PATTERN] list operators\n"));
221+
fprintf(output,_(" \\dp [PATTERN]listtable, view, and sequence access privileges\n"));
222+
fprintf(output,_(" \\z [PATTERN] same as \\dp\n"));
223+
fprintf(output,_(" \\ds[S+] [PATTERN] listsequences\n"));
224+
fprintf(output,_(" \\dt[S+] [PATTERN] listtables\n"));
225+
fprintf(output,_(" \\dT[S+] [PATTERN] listdata types\n"));
226+
fprintf(output,_(" \\du [PATTERN] list roles (users)\n"));
227+
fprintf(output,_(" \\dv[S+] [PATTERN]list views\n"));
228228
fprintf(output,"\n");
229229

230230
fprintf(output,_("Formatting\n"));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp