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

Commit286fb25

Browse files
committed
Make \dS work more like it used to, viz, show only system objects.
1 parentfce573a commit286fb25

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.76 2002/09/21 18:32:54 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.77 2002/09/22 20:44:22 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -884,7 +884,9 @@ testdb=>
884884
This is not the actual command name: the letters i, s, t, v, S
885885
stand for index, sequence, table, view, and system table,
886886
respectively. You can specify any or all of these letters, in any
887-
order, to obtain a listing of all the matching objects.
887+
order, to obtain a listing of all the matching objects. The letter
888+
S restricts the listing to system objects; without S, only non-system
889+
objects are shown.
888890
If <quote>+</quote> is appended to the command name, each object is
889891
listed with its associated description, if any.
890892
</para>

‎src/bin/psql/describe.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.68 2002/09/04 20:31:35 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.69 2002/09/22 20:44:22 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"describe.h"
@@ -1231,7 +1231,7 @@ describeUsers(const char *pattern)
12311231
* i - indexes
12321232
* v - views
12331233
* s - sequences
1234-
* S - system tables (~ '^pg_')
1234+
* S - system tables (pg_catalog)
12351235
* (any order of the above is fine)
12361236
*/
12371237
bool
@@ -1247,7 +1247,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
12471247
PGresult*res;
12481248
printQueryOptmyopt=pset.popt;
12491249

1250-
if (showSystem&& !(showSeq||showIndexes||showViews||showTables))
1250+
if (!(showTables||showIndexes||showViews||showSeq))
12511251
showTables=showViews=showSeq= true;
12521252

12531253
initPQExpBuffer(&buf);
@@ -1296,18 +1296,19 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
12961296
appendPQExpBuffer(&buf,")\n");
12971297

12981298
/*
1299-
* Unless showSystem is specified, we suppress system tables, ie,
1299+
* If showSystem is specified, show only system objects (those in
1300+
* pg_catalog). Otherwise, suppress system objects, including
13001301
* those in pg_catalog and pg_toast. (We don't want to hide temp
13011302
* tables though.)
13021303
*/
13031304
if (showSystem)
1304-
processNamePattern(&buf,pattern, true, false,
1305-
"n.nspname","c.relname",NULL,
1306-
"pg_catalog.pg_table_is_visible(c.oid)");
1305+
appendPQExpBuffer(&buf," AND n.nspname = 'pg_catalog'\n");
13071306
else
1308-
processNamePattern(&buf,pattern, true, false,
1309-
"n.nspname","c.relname",NULL,
1310-
"pg_catalog.pg_table_is_visible(c.oid) AND n.nspname <> 'pg_catalog' AND n.nspname <> 'pg_toast'");
1307+
appendPQExpBuffer(&buf," AND n.nspname NOT IN ('pg_catalog', 'pg_toast')\n");
1308+
1309+
processNamePattern(&buf,pattern, true, false,
1310+
"n.nspname","c.relname",NULL,
1311+
"pg_catalog.pg_table_is_visible(c.oid)");
13111312

13121313
appendPQExpBuffer(&buf,"ORDER BY 1,2;");
13131314

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp