X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 13EC19FA279 for ; Tue, 23 May 2006 15:36:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 26239-08 for ; Tue, 23 May 2006 15:36:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id EB53A9FA169 for ; Tue, 23 May 2006 15:36:06 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k4NIa2Kf017254; Tue, 23 May 2006 14:36:03 -0400 (EDT) To: rolf.unger@ctilabs.de cc: pgsql-docs@postgresql.org Subject: Re: Pattern with backslash commands in psql terminal In-reply-to: <20060523180354.GA3057@inari.ctilabs.internal> References: <20060523180354.GA3057@inari.ctilabs.internal> Comments: In-reply-to Rolf Unger message dated "Tue, 23 May 2006 20:03:54 +0200" Date: Tue, 23 May 2006 14:36:02 -0400 Message-ID: <17253.1148409362@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/43 X-Sequence-Number: 3570 Rolf Unger 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