pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexey V. Neyman <avn@any.ru>
To: pgsql-sql@postgresql.org
Cc: pgsql-bugs@postgresql.org
Subject: No subselects in constraint (bug?)
Date: Fri, 13 Jul 2001 14:16:23 +0400 (MSD)
Message-ID: <20010713135728.U2566-100000@srv2.any> (raw)

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 )-+---------------------------




view thread (3+ messages)  latest in thread

Message-ID: <20010713135728.U2566-100000@srv2.any>
Permalink:  ../20010713135728.U2566-100000@srv2.any/
Also on:    postgresql.org/message-id/20010713135728.U2566-100000@srv2.any

 · 

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: avn@any.ru, pgsql-bugs@postgresql.org
  Subject: Re: No subselects in constraint (bug?)
  In-Reply-To: <20010713135728.U2566-100000@srv2.any>

* 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