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

From Joel Jacobson
Subject Re: pl/pgsql feature request: shorthand for argument and local variable references
Date
Msg-id 251c0e9c-cda9-457f-ae60-4e0ec46affe6@www.fastmail.com
Whole thread Raw
In response to Re: pl/pgsql feature request: shorthand for argument and local variable references  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pl/pgsql feature request: shorthand for argument and local variable references
List pgsql-hackers
On Thu, Jan 6, 2022, at 17:55, Tom Lane wrote:
> 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.

Perhaps the "in." notation could be standardized by the SQL standard,
allowing vendors to use such notation without fear of future trouble?

> 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 would say we have two OK workarounds, far from perfect:
* Qualifying parameters is too verbose. Function names can be long.
* Having to remap parameters using ALIAS is cumbersome.

This problem is one of my top annoyances with PL/pgSQL.

/Joel




pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: terminate called after throwing an instance of 'std::bad_alloc' (llvmjit)
Next
From: Andrew Dunstan
Date:
Subject: Re: Suggestion: optionally return default value instead of error on failed cast