Re: simple problem - Mailing list pgsql-sql

From Tom Lane
Subject Re: simple problem
Date
Msg-id 25416.1015445199@sss.pgh.pa.us
Whole thread Raw
In response to simple problem  ("Daniel Ordobas Bortolas" <bortolas@inf.UFSM.br>)
List pgsql-sql
"Daniel Ordobas Bortolas" <bortolas@inf.UFSM.br> writes:
> -->create table loco( id_loco int4 not null, primary key (id_loco), check(
> (select count(*) from loco ) < 3 ) );
> ->insert into loco values(1);
> the result is: ERROR:  ExecEvalExpr: unknown expression type 108

Subselects aren't supported in check constraints (and if you were
running a version newer than 7.0.*, it would've told you so ...)

Possibly you could do what you want with a trigger function.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Llew"
Date:
Subject: where not exists
Next
From: "PG Explorer"
Date:
Subject: Re: simple problem