Re: ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found
Дата
Msg-id 005901c10e9b$ab5cf400$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found  (Dado Feigenblatt <dado@wildbrain.com>)
Список pgsql-sql
From: "Dado Feigenblatt" <dado@wildbrain.com>

> I'm trying to create some tables with foreign keys.
> When I try to create a foreign key ...
> 
>     foreign key(seq_code) references sequences(seq_code) on update 
> CASCADE on delete CASCADE,
> 
> I get this message:
> 
>     ERROR:  UNIQUE constraint matching given keys for referenced table 
> "sequences" not found
> 
> The problem is that the referenced field and table exist.
> Any hint?

Do you have a unique index on sequences.seq_code?

- Richard Huxton



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

Предыдущее
От: Dado Feigenblatt
Дата:
Сообщение: ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found
Следующее
От: Maxim Maletsky
Дата:
Сообщение: RE: Re: drop table if exists