Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files
Дата
Msg-id 8f910b2b-6f31-5e10-cc4d-ac95f0813bae@2ndquadrant.com
обсуждение исходный текст
Ответ на [HACKERS] psql's \d and \dt are sending their complaints to different output files  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
Ответы Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [BUGS] [HACKERS] Re: Postgresql bug report - unexpected behaviorof suppress_redundant_updates_trigger
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: [BUGS] [HACKERS] Re: Postgresql bug report - unexpected behaviorof suppress_redundant_updates_trigger