Re: bug in integration SQL parser to plpgsq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug in integration SQL parser to plpgsq
Date: 2010-01-12 15:49:47
Message-ID: 4611.1263311387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> it doesn't support EXPLAIN as possible begin of SQL statement:

> postgres=# create or replace function foo(_a int) returns void as
> $$declare s varchar; begin for s in explain select * from omega where
> a = _a loop raise notice '%', s; end loop; return; end; $$ language
> plpgsql;
> CREATE FUNCTION
> postgres=# select foo(10);
> ERROR: column "_a" does not exist
> CONTEXT: PL/pgSQL function "foo" line 1 at FOR over SELECT rows

No, that's got nothing to do with EXPLAIN per se. It's not passing
down the parameter resolution hook into utility statements in general.
This may take a little bit of thought to fix :-(

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-01-12 15:54:57 Re: Typed tables
Previous Message Magnus Hagander 2010-01-12 15:12:18 Re: pg_dump sort order for functions