Re: Unique and Primary Key Constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unique and Primary Key Constraints
Date: 2002-07-13 17:03:55
Message-ID: 3930.1026579835@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rod Taylor <rbt(at)zort(dot)ca> writes:
> Yup. Makes sense. I submitted a patch which retains the difference.
> If the index is created with CREATE UNIQUE, it's dumped with CREATE
> UNIQUE. Constraint UNIQUE is treated likewise.

Yes, I was going to suggest that --- we should try to reproduce the way
that the definition was created, not enforce our own ideas of style.

CREATE INDEX will always be more flexible than constraints anyway
(non-default index type, non-default opclasses, partial indexes for
starters) so the notion that it might go away someday is a nonstarter.

Rod's original pg_depend patch tried to make a pg_constraint entry for
any unique index, but I changed it to only make entries for indexes
that were actually made from constraint clauses, so the distinction
is preserved in the system catalogs. Just a matter of having pg_dump
respect it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-13 17:07:52 Re: [COMMITTERS] pgsql/ oc/src/sgml/catalogs.sgml oc/src/sgml/r ...
Previous Message Tom Lane 2002-07-13 16:53:16 Re: Memo on dropping practices