Re: Foreign Key Unique Constraint can be dropped

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Vlado Moravec <vm(dot)devs(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign Key Unique Constraint can be dropped
Date: 2009-06-08 11:52:54
Message-ID: 2f4958ff0906080452h6b949ddcj28270b65d4563abe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 8, 2009 at 11:48 AM, Vlado Moravec<vm(dot)devs(at)gmail(dot)com> wrote:
> Hi,
> from postgres docs: "foreign key must reference columns that either are a
> primary key or form a unique constraint". It does not allow creating foreign
> key constraint on non-unique column - an error is raised.
> After playing with a new database I discovered that such a unique constraint
> can be droped after the foreign key constraint has been established. No
> warning, no error.
> Is such a behaviour intended? I have found no references in the docs.

what version of postgresql you're testing it on ?
you're sure that foreign key isn't dropped as well ?
On 8.3 and 8.4 it doesn't allow me to do it, unless I drop
index/constraint cascade, in which case foreign key constraint gets
dropped as well.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dimitri Fontaine 2009-06-08 11:54:12 Re: invalid byte sequence for encoding "UTF8": 0xab
Previous Message Dimitri Fontaine 2009-06-08 11:37:00 Re: PL/PGSQL