Re: Creating a table: UNIQUE constraint matching given keys for referenced table "xy" not found

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Creating a table: UNIQUE constraint matching given keys for referenced table "xy" not found
Дата
Msg-id 20030807142724.GA5549@wolff.to
обсуждение исходный текст
Ответ на Creating a table: UNIQUE constraint matching given keys for referenced table "xy" not found  (Jason Hihn <jhihn@paytimepayroll.com>)
Список pgsql-novice
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.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Jason Hihn
Дата:
Сообщение: Creating a table: UNIQUE constraint matching given keys for referenced table "xy" not found
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Creating a table: UNIQUE constraint matching given keys for referenced table "xy" not found