On Thu, Sep 3, 2009 at 12:48 AM, Keith Cascio<keith@cs.ucla.edu> wrote:
> Pavel,
>
> On Thu, 3 Sep 2009, Pavel Stehule wrote:
>
>> it's not bug - PostgreSQL doesn't support parameter placeholder on this
>> position. Use dynamic query instead - plpgsql statement EXECUTE.
>
> Thank you for your reply. =A0I appreciate your suggestion, but it still s=
eems like
> a bug to me. =A0Please comment on the fact that the following code succee=
ds:
>
> create function reproduce() returns table(foo integer) language plpgsql as
> 'begin return query select 1 bar; end;';
>
> Output in psql is:
> CREATE FUNCTION
>
> Why should it succeed with "bar" but not with "foo"?
This is a very common gotcha in plpgsql. I always prefix function
arguments and and locals with _;
merlin