Re: psql's \d display of unique index vs. constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: psql's \d display of unique index vs. constraint
Дата
Msg-id 8780.1271187360@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: psql's \d display of unique index vs. constraint  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: psql's \d display of unique index vs. constraint  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
Peter Eisentraut <peter_e@gmx.net> writes:
> On fre, 2010-04-09 at 18:01 -0400, Josh Kupershmidt wrote:
>> I often come across tables with either a unique index or a unique
>> constraint on them, and psql isn't helpful at showing the difference
>> between the two. Normally, I don't care which is which, except for
>> when I have to manually drop and recreate the index or constraint to
>> speed up a bulk load.

> Yes, I have also been annoyed by that.  Perhaps you could work out a
> proposed change and send it to the hackers list.  You don't necessarily
> need to code it up, but make some mock-ups about how things would look
> in different situations.

Please note that we already rejected the use of a separate constraints
subheading in connection with EXCLUDE constraints; a patch to introduce
one in order to distinguish unique constraints from manually-created
unique indexes isn't likely to fare much better.  My recollection is
that it's intentional that psql obscures the difference, because for
most querying purposes there isn't any difference.  I agree that
sometimes you'd like to know the difference, so I could see making some
small change that would make it possible to tell the difference when
needed.  But I think it shouldn't make the two cases look completely
unrelated.  Maybe something like saying "unique constraint" vs just
"unique" would fly.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: When is an explicit cast necessary?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Showing debug messages in my C function