Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6DGYBa48910 for ; Fri, 13 Jul 2001 12:34:11 -0400 (EDT) (envelope-from pgsql-bugs-owner@postgresql.org) Received: from ajax2.sovam.com (ajax2.sovam.com [194.67.1.173]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6DAE6a41410; Fri, 13 Jul 2001 06:14:07 -0400 (EDT) (envelope-from avn@any.ru) Received: from ts9-a142.dial.sovam.com ([195.239.70.142]:1275 "EHLO srv2.any" ident: "TIMEDOUT" whoson: "-unregistered-" smtp-auth: TLS-CIPHER: TLS-PEER: ) by ajax2.sovam.com with ESMTP id ; Fri, 13 Jul 2001 14:13:44 +0400 Received: from localhost (avn@localhost) by srv2.any (8.11.4/8.11.4) with ESMTP id f6DAGNQ10522; Fri, 13 Jul 2001 14:16:23 +0400 (MSD) (envelope-from avn@any.ru) Date: Fri, 13 Jul 2001 14:16:23 +0400 (MSD) From: "Alexey V. Neyman" X-X-Sender: To: cc: Subject: No subselects in constraint (bug?) Message-ID: <20010713135728.U2566-100000@srv2.any> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200107/62 X-Sequence-Number: 1844 Hello there! [Please Cc: me in followups.] I tried the following: CREATE TABLE a ( int4 id ); CREATE TABLE b ( int4 id CHECK (id = ANY(SELECT a.id FROM a)) ); Tables are created ok, checking with '\d table' confirms it. But when I try to insert into table b, e.g.: INSERT INTO b (id) VALUES (0); I get: ERROR: ExecEvalExpr: unknown expression type 108 Of course, the tuple is not inserted. As quick dig of code showed, type 108 is T_SubLink which is created for ANY() subselect, and ExecEvalExpr() function does not handle this type of node. Is it intentional or a bug? I use 7.0.3, but 7.1.2 code looks pretty the same in ExecEvalExpr(). The platform is FreeBSD 4.3-R. TIA for responses, Alexey. -- -------------------------------------------------+--------------------------- Yes. We have good news! | Regards, Alexey V. Neyman Well, that is to say, we have no news. | mailto: avn@any.ru ----------------------------------( Pkunk, SC2 )-+---------------------------