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

From Peter Eisentraut
Subject Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files
Date
Msg-id 8f910b2b-6f31-5e10-cc4d-ac95f0813bae@2ndquadrant.com
Whole thread Raw
In response to [HACKERS] psql's \d and \dt are sending their complaints to different output files  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
Responses Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files
Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files
List pgsql-hackers
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.
> 
> I've noticed the difference exactly because my output was
> (accidentally) redirected to a file and I didn't see the complaint from
> the 2nd backslash command.

I think this is intentional.

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.

Maybe there is something to tweak here, but the basic distinction of
what is an error and what isn't should be preserved.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [BUGS] [HACKERS] Re: Postgresql bug report - unexpected behaviorof suppress_redundant_updates_trigger
Next
From: Chapman Flack
Date:
Subject: Re: [BUGS] [HACKERS] Re: Postgresql bug report - unexpected behaviorof suppress_redundant_updates_trigger