Re: pl/pgsql feature request: shorthand for argument and local variable references - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pl/pgsql feature request: shorthand for argument and local variable references
Date
Msg-id 1085351.1641488103@sss.pgh.pa.us
Whole thread Raw
In response to Re: pl/pgsql feature request: shorthand for argument and local variable references  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: pl/pgsql feature request: shorthand for argument and local variable references
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> čt 6. 1. 2022 v 16:59 odesílatel Joel Jacobson <joel@compiler.org> napsal:
>> How could the SQL parser have a problem with it, if "in" is currently
>> never followed by "." (dot)?

> you can check it. It is true, so IN is usually followed by "(", but until
> check I am not able to say if there will be an unwanted shift or collision
> or not.

Even if it works today, we could be letting ourselves in for future
trouble.  The SQL standard is a moving target, and they could easily
standardize some future syntax involving IN that creates a problem here.

I think we already have two perfectly satisfactory answers:
* qualify parameters with the function name to disambiguate them;
* use the ALIAS feature to create an internal, shorter name.
I see no problem here that is worth locking ourselves into unnecessary
syntax assumptions to fix.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: pl/pgsql feature request: shorthand for argument and local variable references
Next
From: Justin Pryzby
Date:
Subject: Re: terminate called after throwing an instance of 'std::bad_alloc' (llvmjit)