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

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Josh Kupershmidt <schmiddy(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: psql's \d display of unique index vs. constraint
Date: 2010-04-13 20:53:03
Message-ID: w2tdcc563d11004131353n59e34534t3c9939a946614dd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Apr 13, 2010 at 1:36 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)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.

Yeah, probably make it show up for \d+ or something.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-04-13 23:23:01 Re: Unknown winsock error 10061
Previous Message Tom Lane 2010-04-13 20:04:04 Re: Showing debug messages in my C function

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-04-13 22:00:20 Re: How to generate specific WAL records?
Previous Message Rusty Conover 2010-04-13 20:38:39 Re: BUG #5412: Crash in production SIGSEGV, equalTupleDescs (tupdesc1=0x7f7f7f7f, tupdesc2=0x966508c4) at tupdesc.c