Re: unique across two tables

From: Edoardo Panfili <edoardo(at)aspix(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: unique across two tables
Date: 2011-06-23 18:39:05
Message-ID: 4E038849.6090109@aspix.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 22/06/11 18.30, David Johnston wrote:
> The only (obvious to me) way to really solve the problem - invisibly - is to
> allow for table-less unique indexes that multiple tables can share and that
> have a pointer to the "source" table for any particular entry in the index.
> The other method being discussed effectively uses a physical table to
> implement this behavior.

I Have the same problem: one ID must be unique.
Three tables inherits from the same parent table the id column, the ID
is is defined as:
id bigint DEFAULT nextval('sequence_name')
in the parent table.

Can I assume that a sequence ensures uniqueness?

And... I did some search on Google but can't figure "table-less unique
indexes that multiple tables can share" where can I find further
information regarding this thing?

thank you
Edoardo

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hernan gonzalez 2011-06-23 18:40:51 Re: to_timestamp() and timestamp without time zone
Previous Message Steve Crawford 2011-06-23 18:25:29 Re: to_timestamp() and timestamp without time zone