Re: bug in integration SQL parser to plpgsq - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug in integration SQL parser to plpgsq
Date
Msg-id 4611.1263311387@sss.pgh.pa.us
Whole thread Raw
In response to bug in integration SQL parser to plpgsq  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.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


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pg_dump sort order for functions
Next
From: Peter Eisentraut
Date:
Subject: Re: Typed tables