Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
33e7eac3
Commit
33e7eac3
authored
Apr 02, 2009
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change psql \d* display so 'S' _or_ a pattern include system objects.
parent
248891f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
50 deletions
+50
-50
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/ref/psql-ref.sgml
+28
-28
src/bin/psql/describe.c
src/bin/psql/describe.c
+22
-22
No files found.
doc/src/sgml/ref/psql-ref.sgml
View file @
33e7eac3
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.22
0 2009/02/26 16:02:37 petere
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.22
1 2009/04/02 15:15:31 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -853,9 +853,9 @@ testdb=>
more information is displayed: any comments associated with the
columns of the table are shown, as is the presence of OIDs in the
table.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
<note>
...
...
@@ -879,9 +879,9 @@ testdb=>
return type and the data types they operate on. If <replaceable
class="parameter">pattern</replaceable>
is specified, only aggregates whose names match the pattern are shown.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
</listitem>
</varlistentry>
...
...
@@ -910,9 +910,9 @@ testdb=>
If <replaceable class="parameter">pattern</replaceable>
is specified, only conversions whose names match the pattern are
listed.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
</listitem>
</varlistentry>
...
...
@@ -939,9 +939,9 @@ testdb=>
class="parameter">pattern</replaceable>, or of all visible objects if
no argument is given. But in either case, only objects that have
a description are listed.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
(<quote>Object</quote> covers aggregates, functions, operators,
types, relations (tables, views, indexes, sequences, large
objects), rules, and triggers.) For example:
...
...
@@ -971,9 +971,9 @@ testdb=>
Lists all available domains. If <replaceable
class="parameter">pattern</replaceable>
is specified, only matching domains are shown.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
</listitem>
</varlistentry>
...
...
@@ -1045,9 +1045,9 @@ testdb=>
is specified, only functions whose names match the pattern are shown.
If the form <literal>\df+</literal> is used, additional information about
each function, including volatility, language, source code and description, is shown.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
<note>
...
...
@@ -1155,9 +1155,9 @@ testdb=>
and tables. If <literal>+</literal> is
appended to the command name, each object is listed with its
physical size on disk and its associated description, if any.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
<para>
...
...
@@ -1202,9 +1202,9 @@ testdb=>
Lists available operators with their operand and return types.
If <replaceable class="parameter">pattern</replaceable> is
specified, only operators whose names match the pattern are listed.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
</listitem>
</varlistentry>
...
...
@@ -1237,9 +1237,9 @@ testdb=>
class="parameter">pattern</replaceable>. The command form
<literal>\dT+</literal> shows extra information, namely the type's internal name, size, and
allowed values for <type>enum</> types.
The letter <literal>S</literal> adds the listing of system
objects; without <literal>S</literal>, only non-
system
objects
are shown
.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include
system
objects.
</para>
</listitem>
</varlistentry>
...
...
src/bin/psql/describe.c
View file @
33e7eac3
...
...
@@ -8,7 +8,7 @@
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.20
3 2009/03/26 22:26:07 petere
Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.20
4 2009/04/02 15:15:32 momjian
Exp $
*/
#include "postgres_fe.h"
...
...
@@ -94,7 +94,7 @@ describeAggregates(const char *pattern, bool verbose, bool showSystem)
"WHERE p.proisagg
\n
"
,
gettext_noop
(
"Description"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -281,7 +281,7 @@ describeFunctions(const char *pattern, bool verbose, bool showSystem)
" AND p.proargtypes[0] IS DISTINCT FROM 'pg_catalog.cstring'::pg_catalog.regtype
\n
"
" AND NOT p.proisagg
\n
"
);
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -372,7 +372,7 @@ describeTypes(const char *pattern, bool verbose, bool showSystem)
else
appendPQExpBuffer
(
&
buf
,
" AND t.typname !~ '^_'
\n
"
);
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
/* Match name pattern against either internal or external name */
...
...
@@ -427,10 +427,10 @@ describeOperators(const char *pattern, bool showSystem)
gettext_noop
(
"Result type"
),
gettext_noop
(
"Description"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
,
true
,
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
true
,
"n.nspname"
,
"o.oprname"
,
NULL
,
"pg_catalog.pg_operator_is_visible(o.oid)"
);
...
...
@@ -631,7 +631,7 @@ objectDescription(const char *pattern, bool showSystem)
" WHERE p.proisagg
\n
"
,
gettext_noop
(
"aggregate"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -654,7 +654,7 @@ objectDescription(const char *pattern, bool showSystem)
" AND NOT p.proisagg
\n
"
,
gettext_noop
(
"function"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -672,10 +672,10 @@ objectDescription(const char *pattern, bool showSystem)
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = o.oprnamespace
\n
"
,
gettext_noop
(
"operator"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
,
false
,
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"o.oprname"
,
NULL
,
"pg_catalog.pg_operator_is_visible(o.oid)"
);
...
...
@@ -690,10 +690,10 @@ objectDescription(const char *pattern, bool showSystem)
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
\n
"
,
gettext_noop
(
"data type"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
,
false
,
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"pg_catalog.format_type(t.oid, NULL)"
,
NULL
,
"pg_catalog.pg_type_is_visible(t.oid)"
);
...
...
@@ -714,7 +714,7 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"view"
),
gettext_noop
(
"index"
),
gettext_noop
(
"sequence"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -734,7 +734,7 @@ objectDescription(const char *pattern, bool showSystem)
" WHERE r.rulename != '_RETURN'
\n
"
,
gettext_noop
(
"rule"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
/* XXX not sure what to do about visibility rule here? */
...
...
@@ -753,11 +753,11 @@ objectDescription(const char *pattern, bool showSystem)
" JOIN pg_catalog.pg_class c ON c.oid = t.tgrelid
\n
"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
\n
"
,
gettext_noop
(
"trigger"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
/* XXX not sure what to do about visibility rule here? */
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
,
false
,
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"t.tgname"
,
NULL
,
"pg_catalog.pg_table_is_visible(c.oid)"
);
...
...
@@ -808,10 +808,10 @@ describeTableDetails(const char *pattern, bool verbose, bool showSystem)
"FROM pg_catalog.pg_class c
\n
"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
\n
"
);
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
,
false
,
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"c.relname"
,
NULL
,
"pg_catalog.pg_table_is_visible(c.oid)"
);
...
...
@@ -2008,12 +2008,12 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
appendPQExpBuffer
(
&
buf
,
"'i',"
);
if
(
showSeq
)
appendPQExpBuffer
(
&
buf
,
"'S',"
);
if
(
showSystem
)
if
(
showSystem
||
pattern
)
appendPQExpBuffer
(
&
buf
,
"'s',"
);
/* was RELKIND_SPECIAL in <= 8.1 */
appendPQExpBuffer
(
&
buf
,
"''"
);
/* dummy */
appendPQExpBuffer
(
&
buf
,
")
\n
"
);
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
/* Exclude system and pg_toast objects, but show temp tables */
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
...
...
@@ -2087,7 +2087,7 @@ listDomains(const char *pattern, bool showSystem)
gettext_noop
(
"Modifier"
),
gettext_noop
(
"Check"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -2142,7 +2142,7 @@ listConversions(const char *pattern, bool showSystem)
gettext_noop
(
"yes"
),
gettext_noop
(
"no"
),
gettext_noop
(
"Default?"
));
if
(
!
showSystem
)
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment