Thread: BUG #5143: psql \df doesn't recogize patterns

BUG #5143: psql \df doesn't recogize patterns

From
"Piotr Wolinski"
Date:
The following bug has been logged online:

Bug reference:      5143
Logged by:          Piotr Wolinski
Email address:      pwolinski@dfqs.pl
PostgreSQL version: 8.4.1
Operating system:   PLD Linux 2.6.21.1 x86_64
Description:        psql \df doesn't recogize patterns
Details:

It looks like pqsl \df command doesn't recognize regexp pattern.

Works fine:
\df public.*
\df p*c.*
\dt (public|my_schema).*

Returns 0 rows:
\df (public|my_schema).*
\df (public).*

Re: BUG #5143: psql \df doesn't recogize patterns

From
Alvaro Herrera
Date:
Piotr Wolinski wrote:

> It looks like pqsl \df command doesn't recognize regexp pattern.

No, it doesn't use regexes, only shell patterns (* and ? only).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: BUG #5143: psql \df doesn't recogize patterns

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Piotr Wolinski wrote:
>> It looks like pqsl \df command doesn't recognize regexp pattern.

> No, it doesn't use regexes, only shell patterns (* and ? only).

The case does work for \d though.  It appears that \df is passing
force_escape = true to processSQLNamePattern.  That's probably a
bug --- it makes sense for \do, but function names aren't special
so there's no reason to prevent people from using regexp patterns.

            regards, tom lane

Re: BUG #5143: psql \df doesn't recogize patterns

From
Tom Lane
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
>> Piotr Wolinski wrote:
>>> It looks like pqsl \df command doesn't recognize regexp pattern.

>> No, it doesn't use regexes, only shell patterns (* and ? only).

> The case does work for \d though.

And, in fact, it did work for \df too, up until last April when
somebody broke it while fooling around with window function display.
Patched ...

            regards, tom lane

Re: BUG #5143: psql \df doesn't recogize patterns

From
Piotr Woliński
Date:
Alvaro Herrera pisze:
> Piotr Wolinski wrote:
>
>
>> It looks like pqsl \df command doesn't recognize regexp pattern.
>>
>
> No, it doesn't use regexes, only shell patterns (* and ? only).
>
>
Is documentation correct? There is descprition just like \dt \dv and
other commands.

http://www.postgresql.org/docs/8.4/interactive/app-psql.html

\df[antwS+] [ /pattern/ ]
   Lists available functions, together with their arguments, return   types, and their function types: 'agg'
(aggregate),'normal',   'trigger', and 'window'. To display only functions of a specific   type, use the corresponding
lettersa, n, t, or w. If /pattern/ is   specified, only functions whose names match the pattern are shown.   If the
form\df+ is used, additional information about each   function, including volatility, language, source code and
description,is shown. By default, only user-created objects are   shown; supply a pattern or the S modifier to include
systemobjects. 



--
Piotr Woliński, biuro IT

Dom Finansowy QS Sp. z o.o. z siedzibą w Gdańsku, ul. Piastowska 11,
wpisany do Rejestru Przedsiębiorców Krajowego Rejestru Sądowego
przez Sąd Rejonowy Gdańsk-Północ w Gdańsku pod numerem KRS 66674,
z kapitałem zakładowym w wysokości 50.000,00 PLN, NIP 957-08-11-591.