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

From Tom Lane
Subject Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2
Date
Msg-id 12752.1242928379@sss.pgh.pa.us
Whole thread Raw
In response to [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2  (Steve Prentice <prentice@cisco.com>)
Responses Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v3  (Steve Prentice <prentice@cisco.com>)
Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Steve Prentice <prentice@cisco.com> writes:
> This patch is intended to supplement Pavel's patch for named and mixed  
> notation support in 8.5. This patch makes it so a plpgsql function can  
> call another function with the same parameter names using the named  
> parameters notation.

Well, plpgsql's parsing has always been a kluge, but I think this is
really taking the kluge level a step too far.  It's only because AS
is used in so few contexts that this can even pretend to work --- but
there are still an awful lot of contexts where AS is used, and will
likely be more in the future.  So I think it's pretty un-future-proof;
and it certainly won't scale to any other contexts where we might wish
that plpsql variables don't get substituted.

It's probably time to bite the bullet and redo the parser as has been
suggested in the past, ie fix things so that the main parser is used.
Ideally I'd like to switch the name resolution priority to be more
Oracle-like, but even if we don't do that it would be a great
improvement to have actual syntactic knowledge behind the lookups.

Just for the record, you'd have to put the same kluge into the T_RECORD
and T_ROW cases if we wanted to do it like this.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Steve Prentice
Date:
Subject: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2
Next
From: Greg Stark
Date:
Subject: Re: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?