Re: pl/pgsql feature request: shorthand for argument and local variable references

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pl/pgsql feature request: shorthand for argument and local variable references
Date: 2022-01-06 19:24:17
Message-ID: CAFj8pRAzZgYCFm3DbXZDKAnKMA2PqoBPvDvt0LQoj-5iSt9jug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

čt 6. 1. 2022 v 20:03 odesílatel Joel Jacobson <joel(at)compiler(dot)org> napsal:

> On Thu, Jan 6, 2022, at 19:03, Pavel Stehule wrote:
> > The possibility to define a label dynamically is a better solution (not
> by some buildin keyword),
> > because it allows some possibility for the end user to define what he
> prefers.
>
> I'm trying to understand why you think a user-defined notation is
> desirable,
> why it wouldn't be better if the SQL standard would endorse a notation,
> so we could all write code in the same way, avoiding ugly GUCs or PRAGMAs
> altogether?
>

But there is nothing similar in standard. Standard doesn't specify any
column or table or label names in the custom area.

The ADA language, an PL/SQL origin, and the PL/pgSQL origin has not nothing
similar too. Moreover it (ADA language) was designed as a safe, very
verbose language without implicit conventions.

I think we have different positions, because we see different usage, based
on, probably, a different programming style. I can understand the request
for special common notation for access for routine parameters. But the "in"
keyword for this case is not good, and I really think it is better to give
some freedom to the user to choose their own label, if we don't know the
best one.

> If "in." would work, due to "in" being a reserved SQL keyword,
> don't you think the benefits of a SQL standardized solution would outweigh
> our
> personal preferences on what word each one of us prefer?
>

I know that "in" is a reserved word in SQL, but I have not any knowledge of
it being used as alias in SQL functions or in SQL/PSM functions.

> /Joel
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2022-01-06 19:26:43 Re: Collecting statistics about contents of JSONB columns
Previous Message Peter Geoghegan 2022-01-06 19:23:57 Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations