Re: Deferred uniqueness versus foreign keys

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Deferred uniqueness versus foreign keys
Дата
Msg-id 8e2dbb700907281410m3e73ec93p2dd1f0ad3dbb8f53@mail.gmail.com
обсуждение исходный текст
Ответ на Deferred uniqueness versus foreign keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Deferred uniqueness versus foreign keys  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
2009/7/28 Tom Lane <tgl@sss.pgh.pa.us>:
> [sigh, forgot to cc hackers the first time ]
>
> Foreign key behavior is only sane if the referenced column(s) are
> unique.  With the proposed patch, it is possible that the uniqueness
> check on the referenced columns is deferred, which means it might not
> occur till after an FK check does.  Discuss.
>
>                        regards, tom lane
>

Hmm, yes, looking in the SQL spec, I've just noticed this under 11.8,
referential constraint definition:

"The table constraint descriptor describing the <unique constraint
definition> whose <unique column list> identifies the referenced
columns shall indicate that the unique constraint is not deferrable."

which seems like a sensible policy now that I think about it.
- Dean


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

Предыдущее
От: Euler Taveira de Oliveira
Дата:
Сообщение: Re: WIP: to_char, support for EEEE format
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: plpgsql: support identif%TYPE[], (from ToDo)