Re: proposal - plpgsql - support standard syntax for named arguments for cursors

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal - plpgsql - support standard syntax for named arguments for cursors
Date: 2025-02-08 19:56:28
Message-ID: CAFj8pRDCHwKnj=mZXAQLMcTAXkGTO9M5zzGzWB1KGEf4dTn9JA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

so 8. 2. 2025 v 20:25 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > I propose to enhancing to ANSI/SQL standard syntax for named arguments
> > `argname => value`
>
> Is there any reason to think that that's actually in the standard?
> I poked around in SQL:2021 a little and couldn't find anything about
> cursors with arguments at all.
>

I think the possibility to use named arguments in OPEN statements is a
PostgreSQL proprietary feature.
And usage of cursors in PL/pgSQL is based on PL/SQL (not on SQL/PSM from
standard), but named
arguments for cursor is PostgreSQL proprietary feature and the syntax based
on usage `:=` is our
proprietary too.

This is from patch
https://github.com/postgres/postgres/commit/4adead1d224278ff3064636063a818eba17cb211

It is from the window, when the named arguments was supported already

https://www.postgresql.org/message-id/20091008023926.1BE85753FB7@cvs.postgresql.org
(the syntax was changed before release)
but not with ANSI syntax
https://github.com/postgres/postgres/commit/865f14a2d31af23a05bbf2df04c274629c5d5c4d

I forgot to fix this in my patch for 9.5 - probably I missed this
functionality

Regards

Pavel

>
> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-02-08 20:23:39 Re: Final result (display) collation?
Previous Message Tom Lane 2025-02-08 19:25:58 Re: proposal - plpgsql - support standard syntax for named arguments for cursors