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? Using psql and PostgreSQL 7.1.1 on RedHat 7.1 Thanks. -- Dado Feigenblatt Wild Brain, Inc. Technical Director (415) 553-8000 x??? dado@wildbrain.com San Francisco, CA.
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
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера