Re: Primary key and references - Mailing list pgsql-hackers

From Shridhar Daithankar
Subject Re: Primary key and references
Date
Msg-id 200303182030.16124.shridhar_daithankar@persistent.co.in
Whole thread Raw
In response to Re: Primary key and references  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List pgsql-hackers
On Tuesday 18 Mar 2003 8:07 pm, Nigel J. Andrews wrote:
> On Tue, 18 Mar 2003, Shridhar 
Daithankar<shridhar_daithankar@persistent.co.in> wrote:
> > I consider this as a bug but given my understanding of sql, I won't count
> > on it. Any comments?
>
> If a is to be referenced in a foreign key it needs to be unique or how
> could it it be known which of the rows with a given value are being refered
> to. It follows that if a can be referenced in a foreign key then a uniquely
> identifies a row in the referenced table and therefore a primary key of
> (a,b) necessarily is unique based solely on a, i.e. the (a,b) combination
> seems unlikely to be the primary key for the table.

Hmm.. So I need to create unique constraint on original column. OK. Got it 
now..
Shridhar


pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: [INTERFACES] Upgrading the backend's error-message infrastructure
Next
From: Bruce Momjian
Date:
Subject: Re: cursors outside transactions