Re: Primary key and references

From: "Shridhar Daithankar<shridhar_daithankar(at)persistent(dot)co(dot)in>" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Primary key and references
Date: 2003-03-18 15:00:16
Message-ID: 200303182030.16124.shridhar_daithankar@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday 18 Mar 2003 8:07 pm, Nigel J. Andrews wrote:
> On Tue, 18 Mar 2003, Shridhar
Daithankar<shridhar_daithankar(at)persistent(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-03-18 16:19:47 Re: Red Hat snubbed by Oracle
Previous Message Tom Lane 2003-03-18 14:51:07 Re: Red Hat snubbed by Oracle