Re: Create a deferrably-unique index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Create a deferrably-unique index
Date: 2013-08-19 18:34:21
Message-ID: 23968.1376937261@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Jungwirth <pj(at)illuminatedcomputing(dot)com> writes:
> I'm trying to create a unique index where the unique constraint is
> `deferrable initially immediate`. But I don't see any way to do this
> in the syntax of the `create index` command. It looks like the only
> way to do it is via `alter table foo add unique`. Is that right, or
> can I do it as part of `create index`?

Deferrability is a property of a constraint, not an index, so you can
only specify it for indexes that are associated with constraints.
Yes, that limits the kinds of indexes that can be used ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Jungwirth 2013-08-19 18:43:57 Re: Create a deferrably-unique index
Previous Message Paul Jungwirth 2013-08-19 17:45:50 Create a deferrably-unique index