Create a deferrably-unique index

From: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Create a deferrably-unique index
Date: 2013-08-19 17:45:50
Message-ID: CA+6hpakfbvG4MVWD_UzQPUT8+NjkbqS1bvKRUTENz5pu77Vg3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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`?

If I have to use `alter table add unique`, is there any way I can make
sure the implicitly-created index also has a `where` clause? Or is it
impossible to create an index that is unique + deferrable + partial?

Thank you,
Paul

--
_________________________________
Pulchritudo splendor veritatis.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-08-19 18:34:21 Re: Create a deferrably-unique index
Previous Message Vick Khera 2013-08-19 17:42:07 Re: please suggest i need to test my upgrade