Re: Weird misinterpretation of EXECUTE in PL/pgSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Weird misinterpretation of EXECUTE in PL/pgSQL
Date: 2007-02-09 18:54:24
Message-ID: 3396.1171047264@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> In the presence of a comma-separated list of arguments it seems to
> intepret the EXECUTE command wildly differently. What is going on here?

Basically it evaluates the string-producing argument by sticking SELECT
on the front and handing it to the main SQL engine. So what you've got
there is a SELECT that produces two result columns, where the EXECUTE
code was only expecting to get one. (Look at exec_eval_expr in pl_exec.c)

It's a syntax error in any case; not sure if we can easily produce a
better error message, or what a better error message would be.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Lar 2007-02-09 23:17:26 Re: BUG #2393: update fails with unique constraint violation
Previous Message Peter Eisentraut 2007-02-09 18:00:09 Weird misinterpretation of EXECUTE in PL/pgSQL