Re: How to implement a uniqueness constraint across multiple tables? - Mailing list pgsql-general

From Rob Sargent
Subject Re: How to implement a uniqueness constraint across multiple tables?
Date
Msg-id 53DA97DE.50104@gmail.com
Whole thread Raw
In response to Re: How to implement a uniqueness constraint across multiple tables?  (Marti Raudsepp <marti@juffo.org>)
List 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 by date:

Previous
From: Rob Sargent
Date:
Subject: Re: How to implement a uniqueness constraint across multiple tables?
Next
From: Larry White
Date:
Subject: Is it possible to create an index without keeping the indexed data in a column?