Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v3 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v3
Date
Msg-id 603c8f070909140821k3ee3a26by84a9c0ea8529a1aa@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v3  (Steve Prentice <prentice@cisco.com>)
List pgsql-hackers
On Mon, Sep 14, 2009 at 11:02 AM, Steve Prentice <prentice@cisco.com> wrote:
> On Sep 13, 2009, at 10:22 PM, Pavel Stehule wrote:
>
>> 2009/9/14 Tom Lane <tgl@sss.pgh.pa.us>:
>>>
>>> Robert Haas <robertmhaas@gmail.com> writes:
>>>>
>>>> So, I guess I'm sadly left feeling that we should probably reject this
>>>> patch.  Anyone want to argue otherwise?
>>>
>>> +1.  I'm really hoping to get something done about the plpgsql parsing
>>> situation before 8.5 is out, so this should be a dead end anyway.
>>>
>>
>> I have a WIP patch for integration main SQL parser to plpgsql. I'll
>> send it to this weekend.
>
> I certainly don't mind the patch getting rejected and agree that refactoring
> the plpgsql parser is probably the best approach to this issue. However, I
> think it would be more than a little strange to ship the named notation
> feature without a solution for this problem. For reference, the problem is
> that the function below causes a compile error because of the way plpgsql
> blindly does variable replacement:
>
> create function fun1(pDisplayName text) returns void as $$
> begin
>    perform fun2(pDisplayName as pDisplayName);
> -- Above line compiles as:
> --  SELECT  fun2( $1  as  $1 )
> end
> $$ language plpgsql;

Yeah but we already have this problem.  Right now, it typically
happens because of some statement of the form SELECT ... AS ...; this
just adds one more case where it can happen, and I doubt it's any more
common than the case we already struggle with.

But at any rate Tom is planning a fix for 8.5, so I don't think
there's any need to get excited just yet.  If Tom doesn't get his
stuff finished by January, we can revisit the issue then.

...Robert


pgsql-hackers by date:

Previous
From: Steve Prentice
Date:
Subject: Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v3
Next
From: Greg Smith
Date:
Subject: Re: Streaming Replication patch for CommitFest 2009-09