Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id DBED8475CB2 for ; Wed, 6 Mar 2002 15:07:18 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g26K6dS25419; Wed, 6 Mar 2002 15:06:49 -0500 (EST) To: "Daniel Ordobas Bortolas" Cc: pgsql-sql@postgresql.org Subject: Re: simple problem In-reply-to: <20020306150845.39034.qmail@inf.ufsm.br> References: <20020306150845.39034.qmail@inf.ufsm.br> Comments: In-reply-to "Daniel Ordobas Bortolas" message dated "Wed, 06 Mar 2002 15:08:45 +0000" Date: Wed, 06 Mar 2002 15:06:39 -0500 Message-ID: <25416.1015445199@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200203/70 X-Sequence-Number: 6952 "Daniel Ordobas Bortolas" 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