Re: Error Message: ERROR: UNIQUE constraint matching given keys for referenced table 'item' not found

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: <rtmeneses(at)7-eleven(dot)com(dot)ph>
Cc: <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Error Message: ERROR: UNIQUE constraint matching given keys for referenced table 'item' not found
Date: 2003-09-04 19:40:32
Message-ID: 50033.80.177.99.193.1062704432.squirrel@ssl.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

It's rumoured that Robert T. Meneses once said:
> Im having trouble creating foreign key for this
> table (itemsupp) both have itemcode column but
> when I created this error occur telling UNIQUE
> contraint matching. What shall I do?

Hi,

It seems that PostgreSQL wants to have a Unique constraint on the
referenced columns. Can you try something like
ALTER TABLE ref_table ADD CONSTRAINT ref_key UNIQUE (ref_col1, ref_col2);

to add a unique contsraint?

Regards, Dave

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message frank_lupo 2003-09-05 06:40:24 Re: Error Message: ERROR: formato de entrada de
Previous Message Hiroshi Saito 2003-09-04 18:32:01 Re: Error Message: ERROR: UNIQUE constraint matching given keys for referenced table "item" not found