From: Tom Lane <tgl@sss.pgh.pa.us>
To: rolf.unger@ctilabs.de
Cc: pgsql-docs@postgresql.org
Subject: Re: Pattern with backslash commands in psql terminal
Date: Tue, 23 May 2006 14:36:02 -0400
Message-ID: <17253.1148409362@sss.pgh.pa.us> (raw)
In-Reply-To: <20060523180354.GA3057@inari.ctilabs.internal>
References: <20060523180354.GA3057@inari.ctilabs.internal>
Rolf Unger <rolf.unger@ctilabs.de> writes:
> The internal docs say that I can specify an optional pattern after the
> \df or the \df+. And I think I read somewhere that the pattern is meant
> to be a regular expression.
No, it's more a shell-style pattern. Use "*" and "?". "." separates
schema and object name parts of the pattern.
> Are there some special delimiters required? It would be really a good
> thing to have at least a comment or a footnote with any one of the \d
> commands what kind of syntax is needed for the [PATTERN].
Did you read the material at the bottom of the backslash command list?
The various \d commands accept a pattern parameter to specify the object name(s) to be displayed. * means "any
sequence of characters" and ? means "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 [0-9] to
match "any digit". To make any of these pattern-matching characters be interpreted literally, surround it with double
quotes.
A pattern that contains an (unquoted) dot is interpreted as a schema name pattern followed by an object name pattern. For
example, \dt foo*.bar* displays all tables in schemas whose name starts with foo and whose table name starts with
bar. If no dot appears, then the pattern matches only objects that are visible in the current schema search path.
Whenever the pattern parameter is omitted completely, the \d commands display all objects that are visible in the
current schema search path. To see all objects in the database, use the pattern *.*.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rolf.unger@ctilabs.de
Subject: Re: Pattern with backslash commands in psql terminal
In-Reply-To: <17253.1148409362@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox