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
|