Re: Bug in the information_schema.referential_constraints view

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: malerba(at)gnome-db(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in the information_schema.referential_constraints view
Date: 2003-10-16 23:58:37
Message-ID: 16792.1066348717@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane writes:
>> No, because that would entail a genuine loss of capability: FK
>> constraints couldn't be built using indexes that were made by CREATE
>> UNIQUE INDEX rather than through the unique/pk constraint syntax.
>> In particular this would mean that non-btree indexes could not be used.

> But that means the deficiency is elsewhere, namely that you cannot build
> non-btree indexes for primary key or unique constraints.

So are you proposing we extend the constraint syntax instead? I think
it's better to keep our nonstandard index support in a separate,
nonstandard statement (CREATE INDEX) rather than mash it together with
spec-mandated syntax. That seems like a recipe for getting stuck when
the spec adds extensions.

> Isn't the whole unique index thing a dead end anyway? How are we ever
> going to get deferrable unique constraints that way?

The way that was just discussed --- with a deferrable constraint, you
don't elog immediately when the index detects a collision, but make a
note to recheck that particular key value at the time the constraint
should be enforced. I can't imagine that we'd want to do unique
constraints without any index support. How would you avoid having to
check lots and lots of uninteresting rows?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-10-17 19:05:07 Re: data forma error in pgsql 7.1
Previous Message Peter Eisentraut 2003-10-16 23:47:11 Re: Bug in the information_schema.referential_constraints