| From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
|---|---|
| To: | ngterry <ngterry(at)sinaman(dot)com> |
| Cc: | Darren Ferguson <darren(at)crystalballinc(dot)com>, <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: RE:REFERENCES |
| Date: | 2002-03-11 02:03:18 |
| Message-ID: | 20020310180204.P37006-100000@megazone23.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2002-03-11 02:10:19 | Re: problem with upgrade from 6.5 -> 7.2 (fwd) |
| Previous Message | ngterry | 2002-03-11 01:11:14 | RE:REFERENCES |