| От | Najm Hashmi |
|---|---|
| Тема | Correct Syntax for alter table ..add constraint |
| Дата | |
| Msg-id | 3A69DDA0.610029E6@mondo-live.com обсуждение |
| Ответы |
Re: Correct Syntax for alter table ..add constraint
|
| Список | pgsql-sql |
Hi All, What is the correct syntax for adding a foreign key constraint from the command line. I am using v7.1 beta3..... I am doing the follwoing: alter table users add constraint age_fk foreign key(age) references age_list(id); And I get the following error: flipr=# alter table users flipr-# add constraint age_fk foreign key(age) references age_list(id); NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: <unnamed> referential integrity violation - key referenced from users not found in age_list I have define attribute id as primary key of the table....... Thanks for your help. Regards,Najm.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера