PARTIAL, DEFERRABLE UNIQUE CONSTRAINTS

Поиск
Список
Период
Сортировка
От Daniel Migowski
Тема PARTIAL, DEFERRABLE UNIQUE CONSTRAINTS
Дата
Msg-id 41ED3F5450C90F4D8381BC4D8DF6BBDC7A4F39D6@EXCHANGESERVER.ikoffice.de
обсуждение исходный текст
Ответы Re: PARTIAL, DEFERRABLE UNIQUE CONSTRAINTS  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general

Hello,

 

I need to create a deferrable,unique partial constraint (using a WHERE clause) on my table, which in addition should also be deferrable. AFAIK deferrable constraints are just creatable with

 

ALTER TABLE demand ADD CONSTRAINT unique_salesorderitem_id

UNIQUE (salesorderitem_id) DEFERRABLE INITIALLY DEFERRED;

 

but here I miss the WHERE clause. Using the CREATE INDEX notation like this:

 

CREATE UNIQUE INDEX idx_demand_salesorderitem_id_of_parentdemands

    ON demand(salesorderitem_id) WHERE parentdemand_id IS NULL;

 

I cannot specify the deferability (is that a word?). I am Using PostgreSQL 9.1. Is there any way around this?

 

Regards,

Daniel Migowski

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

Предыдущее
От: "McGehee, Robert"
Дата:
Сообщение: Aggregating over nodes in hierarchical trees
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Async IO HTTP server frontend for PostgreSQL