Re: Using subselects in INSERTs? - Mailing list pgsql-general

From Tom Lane
Subject Re: Using subselects in INSERTs?
Date
Msg-id 28433.1066448970@sss.pgh.pa.us
Whole thread Raw
In response to Using subselects in INSERTs?  (J Smith <dark_panda@hushmail.com>)
List pgsql-general
J Smith <dark_panda@hushmail.com> writes:
> After recently upgrading to 7.3.4 from 7.3.1, I started having problems with
> using subselects in INSERTs. I'm seeing things like this (simplified, as
> this is a part of a larger database):

> INSERT INTO t2 (name, ref) VALUES ('bar', (SELECT id FROM t1 WHERE name =
> 'foo'));
> ERROR:  ExecEvalExpr: unknown expression type 108

I tried to reproduce this, but the given example works fine on my 7.3.*
installation.  I also looked through the post-7.3.1 changes in the 7.3
CVS branch to see if there was anything related, but didn't see
anything.

One possible theory is that you didn't do a clean rebuild after updating
your source tree to 7.3.4 ... but I'm not sure how tenable that is; it'd
only be likely to matter if we changed in-memory data structures in the
7.3 branch, and I didn't notice anything like that in perusing the logs.

> The tables look something like

Could you provide an *exact* sequence-to-reproduce rather than
handwaving?  Maybe I'm just missing the problem.  Also, what platform,
compiler, and configure arguments are you using, exactly?

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Help or Bug?
Next
From: Scott Chapman
Date:
Subject: How to quote text before inserting into database?