Re: RE:REFERENCES - Mailing list pgsql-general

From Stephan Szabo
Subject Re: RE:REFERENCES
Date
Msg-id 20020310180204.P37006-100000@megazone23.bigpanda.com
Whole thread Raw
In response to RE:REFERENCES  ("ngterry" <ngterry@sinaman.com>)
List pgsql-general
On Mon, 11 Mar 2002, [big5] ngterry wrote:

>
> I am sorry what I am trying is:
>
> >CREATE TABLE purchase (id int, po int, date date, PRIMARY KEY (id));
> >
> >CREATE TABLE lcopen (lc numeric, po int, PRIMARY KEY (lc));
>
> replace with:
> CREATE TABLE lcopen (lc numeric, po int REFERENCES purchase (po), PRIMARY KEY (lc));
> but there is an error and I do not how to correct that.

The target of a references constraint must be defined to be unique via
either a unique constraint or primary key constraint.  Do you really want
two separate ids on purchase?



pgsql-general by date:

Previous
From: "ngterry"
Date:
Subject: RE:REFERENCES
Next
From: Tom Lane
Date:
Subject: Re: problem with upgrade from 6.5 -> 7.2 (fwd)