pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Ordobas Bortolas <bortolas@inf.UFSM.br>
Cc: pgsql-sql@postgresql.org
Subject: Re: simple problem
Date: Wed, 06 Mar 2002 15:06:39 -0500
Message-ID: <25416.1015445199@sss.pgh.pa.us> (raw)
In-Reply-To: <20020306150845.39034.qmail@inf.ufsm.br>
References: <20020306150845.39034.qmail@inf.ufsm.br>

"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



view thread (10+ messages)  latest in thread

Message-ID: <25416.1015445199@sss.pgh.pa.us>
Permalink:  ../25416.1015445199@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25416.1015445199@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bortolas@inf.UFSM.br
  Subject: Re: simple problem
  In-Reply-To: <25416.1015445199@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox