Re: DB design and foreign keys

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Gianluca Riccardi
Дата:
Сообщение: Re: DB design and foreign keys
Следующее
От: Gianluca Riccardi
Дата:
Сообщение: Re: DB design and foreign keys