| От | Gianluca Riccardi |
|---|---|
| Тема | Re: DB design and foreign keys |
| Дата | |
| Msg-id | 439FF2F9.4090809@moonwatcher.it обсуждение исходный текст |
| Ответ на | Re: DB design and foreign keys (John McCawley <nospam@hardgeus.com>) |
| Список | pgsql-sql |
John McCawley wrote: > Table orders defines the column order_code as a serial, which simple > makes a trigger which gives a new value to the column on insert. Note > that there is NO guarantee that ths column will be unique. You can > manually update the value to whatever you want. If you wish this > column to be unique, you must specify it on creation, or later do an > alter table add constraint to the column. > > A foreign key requires that the referenced column be unique (DB > enforced, not just coincidentally unique), and that' s why your table > creation is failing. [cut] that was my misunderstanding thanks for your reply, Gianluca Riccardi
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера