Re: [GENERAL] feature request: create table with unique constraint

2009-12-17 Thread Tom Lane
writes: > , unique ( a_id , ( case when actual then 0 else id end ) ) > Why can i not define the unique constraint in the > create table? The syntax for a unique constraint in CREATE TABLE is defined by the SQL standard, and it doesn't include expressions. More than the syntax, a unique const

[GENERAL] feature request: create table with unique constraint

2009-12-17 Thread wumpus
begin ; create table a ( id serial primary key , info text not null -- not interested here ) ; create table b ( id serial primary key , a_id int not null references a , info text not null -- not interested here , actual bool not null ) ; create unique index b_actual on b ( a_id , (