Re: psql: display of object comments

Поиск
Список
Период
Сортировка
От Shigeru Hanada
Тема Re: psql: display of object comments
Дата
Msg-id 4E40D686.1090609@gmail.com
обсуждение исходный текст
Ответ на Re: psql: display of object comments  (Josh Kupershmidt <schmiddy@gmail.com>)
Ответы Re: psql: display of object comments  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
(2011/08/09 7:01), Josh Kupershmidt wrote:
>> I am a bit confused as to why we have both \det and \dE.  They seem
>> redundant.  Shouldn't we rip one of those out?  IMHO, \det should be
>> the one to go, as it could be useful to do, e.g. \dtvE, which isn't
>> going to work with the \det syntax.
> 
> Yeah, I was wondering that myself. At first I thought maybe someone
> added in one without being aware of the other, but it looks like both
> \dE and \det got added in by commit
> 0d692a0dc9f0e532c67c577187fe5d7d323cb95b. They are using different
> queries internally (pg_class vs. pg_foreign_table), but I doubt end
> users would care about that. Or perhaps the author just wanted a
> command name similar to \dew and \des.

I'm the author of that patch, sorry for confusion.  May I explain the
background of implementing those command? :)

Basically, during implementing foreign table support, I tried to follow
the existing design.

I found two backslash command groups in psql, \de[wsu] and \d[tvsT],
which are relevant to foreign table.  Former is a group for listing
relation (table, view, sequence and type), and they have common output
format.  Users would use them (sometimes with combination like \dtv) to
list only specified type of relations.  OTOH latter is a group for
listing SQL/MED objects (wrapper, server and user mapping), and commands
in that group have different output columns.  Users would use them to
see detail of FDW options, maybe mainly FDW options.

They had been implemented in different ways then, and I kept
implementation similar to existing codes for each.  But now, as you say,
they seem redundant and inconsistent each other.

> +1 for getting rid of one of them; I don't really care which one gets
> the axe. Though we should make sure to be able to show all possible
> columns in whichever command we keep (i.e. add "Options" column to
> \dE+ if we keep that one).

I'm not sure whether getting rid of one of them is better.
But maybe \dE is useless than \det, because former doesn't shows more
information than simple \d.

>                             BTW, I haven't bothered setting up
> functioning foreign tables yet, but is "Size" always going to be 0
> bytes in \dE+?

Yes, "Size" is total file size calculated with pg_table_size(), but
foreign table has no data file.

Regards,
-- 
Shigeru Hanada


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Selecting user-defined CASTs
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Selecting user-defined CASTs