Search Postgresql Archives

PARTIAL, DEFERRABLE UNIQUE CONSTRAINTS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux