Re: Unique and Primary Key Constraints

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unique and Primary Key Constraints
Date: 2002-07-13 04:20:36
Message-ID: 200207130420.g6D4Kbx18208@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rod Taylor wrote:
> I'm going to change the pg_dump command to pull these constraints out of
> pg_constaint where possible, creating the appropriate alter table add
> constraint command (see primary key).
>
>
> Should unique constraints created with 'create index' (no entry in
> pg_constraint) be re-created via alter table add constraint, or via
> create unique index?

CREATE UNIQUE INDEX has optimization purpose as well as an constraint
purpose. I think CREATE UNIQUE INDEX is the way to go.

> I prefer ...add constraint. After a while (release or 2) removal of
> create unique index all together.

Remove CREATE UNIQUE INDEX entirely? Why?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-07-13 05:33:07 Re: Unique and Primary Key Constraints
Previous Message Neil Conway 2002-07-13 04:06:47 Re: test data for query optimizer