From: | Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Can't drop constraint? |
Date: | 2009-05-06 18:54:20 |
Message-ID: | 200905062054.20847@zmi.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Mittwoch 06 Mai 2009 Tom Lane wrote:
> 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.
To take it to a point: Creating an index has advantages over
constraints, without any disadvantage? So I will always only use
indices, not constraints, to have a more uniform db model.
mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4
From | Date | Subject | |
---|---|---|---|
Next Message | Yves D'Astous | 2009-05-06 18:56:49 | Why postgresql 8.3.5 created temporary files of size less then work_mem on disk ? |
Previous Message | Tom Lane | 2009-05-06 13:54:13 | Re: Can't drop constraint? |