Skip site navigation (1) Skip section navigation (2)

bug in integration SQL parser to plpgsq

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: bug in integration SQL parser to plpgsq
Date: 2010-01-12 10:10:41
Message-ID: 162867791001120210j7db534e1tf45eff7a1f61af66@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello

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

postgres=# create or replace function foo(_a int) returns void as
$$declare s varchar; begin for s in select * from omega where a = _a
loop raise notice '%', s; end loop; return; end; $$ language plpgsql;
CREATE FUNCTION
postgres=# select foo(10);
 foo
-----

(1 row)

Regards
Pavel Stehule

Responses

pgsql-hackers by date

Next:From: Fujii MasaoDate: 2010-01-12 10:15:21
Subject: Re: Streaming replication status
Previous:From: Takahiro ItagakiDate: 2010-01-12 10:10:09
Subject: Re: NOT NULL violation and error-message

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group