From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Niall Smart <niall.smart@ebeon.com>
Cc: pgsql-sql@postgresql.org
Subject: RE: Problem with subquery in CHECK constraint.
Date: Thu, 8 Jun 2000 09:24:50 +0900
Message-ID: <000901bfd0df$f57c1f20$2801007e@tpf.co.jp> (raw)
In-Reply-To: <3912.960392918@sss.pgh.pa.us>
> -----Original Message-----
> From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf
> Of Tom Lane
>
> Niall Smart <niall.smart@ebeon.com> writes:
> > However when trying to insert into CUST I get the following error:
> > ERROR: ExecEvalExpr: unknown expression type 108
> > Is this a bug in PostGreSQL?
>
> Yup. Looks like the subquery is not getting expanded into a subplan.
> Could be a little messy to fix, unless we redo the planning on every
> execution of the check constraint ... which doesn't sound appetizing.
>
There seems to be more serious problems.
1) The constraint is not only for the defined table but also for referenced
tables in the subquery.
2) There should be some standard lock mechanism for the range restricted
by the subquery.
I'm suspicious that we should/could implement constraints other than
column constraints.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: Inoue@tpf.co.jp, tgl@sss.pgh.pa.us, niall.smart@ebeon.com
Subject: Re: Problem with subquery in CHECK constraint.
In-Reply-To: <000901bfd0df$f57c1f20$2801007e@tpf.co.jp>
References: <3912.960392918@sss.pgh.pa.us> <000901bfd0df$f57c1f20$2801007e@tpf.co.jp>
* 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