From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
---|---|
To: | Gregory Stark <gsstark(at)mit(dot)edu> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: bug with constraint dependencies? or bug with |
Date: | 2003-08-28 16:02:02 |
Message-ID: | 20030828085329.N7506-100000@megazone.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 28 Aug 2003, Gregory Stark wrote:
> It seems when you create a new table with the "references" syntax the
> constraint is created with a dependency specifically on a "primary key"
> constraint on the target table.
>
> However when you alter a table to add a foreign key constraint the constraint
> is added with a dependency on any unique index on the column -- not
> necessarily a primary key constraint.
Well, it shouldn't be limited to a primary key constraint (you must be
able to reference a non-primary key unique constraint). If we didn't
need to worry about backward compatiblity, we could make it dependant on
the unique/primary key constraint, not the underlying index (because
upgraded old systems might only generate a unique index). However, that
would only help if the unique constraint were created before the
references constraint.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-08-28 16:13:33 | Re: bug with constraint dependencies? or bug with |
Previous Message | Gregory Stark | 2003-08-28 15:37:18 | bug with constraint dependencies? or bug with pg_dump/pg_restore? |