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
77d2b1b6
Commit
77d2b1b6
authored
Oct 09, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve description of the pattern matching rules used by psql's \d
commands (and soon by pg_dump).
parent
39ed8c40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
15 deletions
+66
-15
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/ref/psql-ref.sgml
+66
-15
No files found.
doc/src/sgml/ref/psql-ref.sgml
View file @
77d2b1b6
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.17
0 2006/10/03 21:14:46 momjian
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.17
1 2006/10/09 23:31:29 tgl
Exp $
PostgreSQL documentation
-->
...
...
@@ -1817,34 +1817,85 @@ lo_import 152801
</variablelist>
</para>
<refsect3 id="APP-PSQL-patterns">
<title id="APP-PSQL-patterns-title">Patterns</title>
<indexterm>
<primary>patterns</primary>
<secondary>in psql and pg_dump</secondary>
</indexterm>
<para>
The various <literal>\d</> commands accept a <replaceable
class="parameter">pattern</replaceable> parameter to specify the
object name(s) to be displayed. <literal>*</> means <quote>any
sequence of characters</> and <literal>?</> means <quote>any single
character</>. (This notation is comparable to Unix shell file name
patterns.) Advanced users can also use regular-expression
notations such as character classes, for example <literal>[0-9]</>
to match <quote>any digit</>. To make any of these
pattern-matching characters be interpreted literally, surround it
with double quotes.
object name(s) to be displayed. In the simplest case, a pattern
is just the exact name of the object. The characters within a
pattern are normally folded to lower case, just as in SQL names;
for example, <literal>\dt FOO</> will display the table named
<literal>foo</>. As in SQL names, placing double quotes around
a pattern stops folding to lower case. Should you need to include
an actual double quote character in a pattern, write it as a pair
of double quotes within a double-quote sequence; again this is in
accord with the rules for SQL quoted identifiers. For example,
<literal>\dt "FOO""BAR"</> will display the table named
<literal>FOO"BAR</> (not <literal>foo"bar</>). Unlike the normal
rules for SQL names, you can put double quotes around just part
of a pattern, for instance <literal>\dt FOO"FOO"BAR</> will display
the table named <literal>fooFOObar</>.
</para>
<para>
Within a pattern, <literal>*</> matches any sequence of characters
(including no characters) and <literal>?</> matches any single character.
(This notation is comparable to Unix shell file name patterns.)
For example, <literal>\dt int*</> displays all tables whose names
begin with <literal>int</>. But within double quotes, <literal>*</>
and <literal>?</> lose these special meanings and are just matched
literally.
</para>
<para>
A pattern that contains a
n (unquoted) dot
is interpreted as a schema
A pattern that contains a
dot (<literal>.</>)
is interpreted as a schema
name pattern followed by an object name pattern. For example,
<literal>\dt foo*.bar*</> displays all tables
in schemas whos
e name
starts with <literal>
foo</> and whose table
name
starts with <literal>
bar</>. If
no dot appears, then the pattern
<literal>\dt foo*.bar*</> displays all tables
whose tabl
e name
starts with <literal>
bar</> that are in schemas whose schema
name
starts with <literal>
foo</>. When
no dot appears, then the pattern
matches only objects that are visible in the current schema search path.
Again, a dot within double quotes loses its special meaning and is matched
literally.
</para>
<para>
Advanced users can use regular-expression notations such as character
classes, for example <literal>[0-9]</> to match any digit. All regular
expression special characters work as specified in
<xref linkend="functions-posix-regexp">, except for <literal>.</> which
is taken as a separator as mentioned above, <literal>*</> which is
translated to the regular-expression notation <literal>.*</>, and
<literal>?</> which is translated to <literal>.</>. You can emulate
these pattern characters at need by writing
<literal>?</> for <literal>.</>,
<literal>(<replaceable class="parameter">R</replaceable>+|)</literal> for
<literal><replaceable class="parameter">R</replaceable>*</literal>, or
<literal>(<replaceable class="parameter">R</replaceable>|)</literal> for
<literal><replaceable class="parameter">R</replaceable>?</literal>.
Remember that the pattern must match the whole name, unlike the usual
interpretation of regular expressions; write <literal>*</> at the beginning
and/or end if you don't wish the pattern to be anchored.
Note that within double quotes, all regular expression special characters
lose their special meanings and are matched literally. Also, the regular
expression special characters are matched literally in operator name
patterns (i.e., the argument of <literal>\do</>).
</para>
<para>
Whenever the <replaceable class="parameter">pattern</replaceable> parameter
is omitted completely, the <literal>\d</> commands display all objects
that are visible in the current schema search path. To see all objects
in the database, use the pattern <literal>*.*</>.
that are visible in the current schema search path — this is
equivalent to using the pattern <literal>*</>.
To see all objects in the database, use the pattern <literal>*.*</>.
</para>
</refsect3>
</refsect2>
<refsect2>
...
...
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