Re: How to implement a uniqueness constraint across multiple tables?

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: How to implement a uniqueness constraint across multiple tables?
Дата
Msg-id 53DA97DE.50104@gmail.com
обсуждение исходный текст
Ответ на Re: How to implement a uniqueness constraint across multiple tables?  (Marti Raudsepp <marti@juffo.org>)
Список pgsql-general
On 07/31/2014 01:16 PM, Marti Raudsepp wrote:
On Thu, Jul 31, 2014 at 9:38 PM, Kynn Jones <kynnjo@gmail.com> wrote:
Does PostgreSQL have a good way to enforce the uniqueness of super_id values
across multiple tables?
Well that's easy: no.

Regards,
Marti


That might be a little hasty.  There are conditional definitions clauses in indices.  One could apply a check such that all subs don't have the id or on each sub such that the others don't have the id.  But can be made unnecessary if inserts to all subs work off same id generator.

rjs

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: How to implement a uniqueness constraint across multiple tables?
Следующее
От: Larry White
Дата:
Сообщение: Is it possible to create an index without keeping the indexed data in a column?