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?