Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by hub.org (8.10.1/8.10.1) with ESMTP id e580Nec40382 for ; Wed, 7 Jun 2000 20:23:40 -0400 (EDT) Received: from cadzone ([126.0.1.40] (may be forged)) by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP id JAA00935; Thu, 08 Jun 2000 09:22:49 +0900 From: "Hiroshi Inoue" To: "Tom Lane" , "Niall Smart" Cc: 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> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <3912.960392918@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal X-Archive-Number: 200006/78 > -----Original Message----- > From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf > Of Tom Lane > > Niall Smart 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