On Thu, Aug 07, 2003 at 10:11:54 -0400,
Jason Hihn <jhihn@paytimepayroll.com> wrote:
>
> Appendix:
> create table xy( x integer not null, y integer not null, primary key (x,y));
> create table xyz( x integer not null references xy(x), y integer not null
> references xy(y), z integer not null, primary key (x,y,z));
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'xyz_pkey'
> for table 'xyz'
> NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
> check(s)
> ERROR: UNIQUE constraint matching given keys for referenced table "xy" not
> found
You either need to create a unique index for x and for y for table xy
or you need to use the foreign key clause to use (x,y) as a reference
to table xy.