Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files
Date
Msg-id CAKFQuwYNyqnxse+B2WGTBC8xTSsFaMxZkAT+bHOr1c0ihM4q6w@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jun 19, 2017 at 2:25 PM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 6/19/17 09:00, Oleksandr Shulgin wrote:
>> I wonder if it is intentional that \d complains on stderr if it cannot
>> find relations to match, but \dt prints the message to the current
>> output file?
>>
>> postgres=# \d xxx
>> Did not find any relation named "xxx".
>> postgres=# \dt xxx
>> No matching relations found.
>>>
> The first command is "show me relation xxx" and that gives an error
> message if it does not exist (and would also create an appropriate exit
> status if certain options are used).
>
> The second command says "show me all relations matched 'xxx'".  The
> result of this is successful execution showing nothing.  The message it
> prints is a "courtesy" message.

The docs indicate the optional argument to both is a pattern so I'm
not seeing why they are treated differently.

The docs also indicate that we don't include materialized views as
part of "\d" which seems like an oversight somewhere.

It sounds like, though isn't specified anywhere, the while you can
write "\dit" to get a subset of all available options omitting all of
the options leaves you with "\d" which is equivalent to specifying
them all.  Which leads on to believe the output from both should be in
sync.

David J.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files