From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Can't drop constraint? |
Date: | 2009-05-06 13:54:13 |
Message-ID: | 4141.1241618053@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at> writes:
> On Dienstag 05 Mai 2009 Tom Lane wrote:
>> Apparently this is just an index, not a constraint (the difference
>> being that it was made with CREATE INDEX, not ALTER TABLE ADD
>> CONSTRAINT). Try
> Is there a performance difference?
No. A primary key or unique constraint is implemented by creating
a unique index (and, for PK, also by creating NOT NULL constraints
on the columns). After that, the only visible difference is that
there's an entry in pg_constraint, or not. There are some minor
behavioral differences --- if memory serves, you need a PK constraint
entry to persuade a REFERENCES constraint that it should consider
a given column as the default reference target --- but no performance
difference.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Monnerie | 2009-05-06 18:54:20 | Re: Can't drop constraint? |
Previous Message | Carol Walter | 2009-05-06 12:47:44 | Re: Can't drop constraint? |