Re: Using subselects in INSERTs?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dark_panda(at)hushmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using subselects in INSERTs?
Date: 2003-10-18 03:49:30
Message-ID: 28433.1066448970@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

J Smith <dark_panda(at)hushmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Chapman 2003-10-18 04:29:40 How to quote text before inserting into database?
Previous Message Tom Lane 2003-10-18 02:57:48 Re: Help or Bug?