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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files
Дата
Msg-id 12010.1497908440@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 6/19/17 09:00, Oleksandr Shulgin wrote:
>> postgres=# \d xxx
>> Did not find any relation named "xxx".
>> postgres=# \dt xxx
>> No matching relations found.

> 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.

I don't buy that line of argument one bit, because both commands take
pattern arguments.

regression=# \d fool*
Did not find any relation named "fool*".
regression=# \dt fool*
No matching relations found.
regression=# create table fool1(f1 int);
CREATE TABLE
regression=# create table fool2(f1 int);
CREATE TABLE
regression=# \d fool*              Table "public.fool1"Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------f1     | integer |           |          | 
              Table "public.fool2"Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------f1     | integer |           |          | 

regression=# \dt fool*        List of relationsSchema | Name  | Type  |  Owner   
--------+-------+-------+----------public | fool1 | table | postgrespublic | fool2 | table | postgres
(2 rows)

AFAICS, this is just randomly different responses for identical
situations.

There's certainly room to quibble about whether this is an error
condition or not, but I'm not very sure which side of that argument
I'd come down on.  In any case the main point is that different
\d commands are doing different things for no very obvious reason.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] CREATE SUBSCRIPTION documentation
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [HACKERS] psql's \d and \dt are sending their complaints todifferent output files