Re: proposal - plpgsql - support standard syntax for named arguments for cursors
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-02-09T05:22:17Z
Lists: pgsql-hackers
so 8. 2. 2025 v 22:25 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal: > Pavel Stehule <pavel.stehule@gmail.com> writes: > > so 8. 2. 2025 v 20:25 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal: > >> Is there any reason to think that that's actually in the standard? > > > 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. > > Hmm ... yeah, it's not in SQL/PSM, but looking at PL/SQL: > > > https://docs.oracle.com/en/database/oracle/oracle-database/19/lnpls/OPEN-statement.html > > I see > > You can specify actual cursor parameters with either > positional notation or named notation. For information about > these notations, see "Positional, Named, and Mixed Notation > for Actual Parameters". > > and that link blesses the use of "name => value" (and not ":="). > So agreed, we should adjust this. > > Is there a reason we need a whole new test case instead of > tweaking one of the existing ones? > just aesthetic reasons - it looks strange for me to mix two styles in one code. But in this very simple case - it is not important. please, modify tests how you like Regards Pavel > > regards, tom lane >
Commits
-
Allow => syntax for named cursor arguments in plpgsql.
- 246dedc5d028 18.0 landed
-
Allow named parameters to be specified using => in addition to :=
- 865f14a2d31a 9.5.0 cited
-
Add support for passing cursor parameters in named notation in PL/pgSQL.
- 4adead1d2242 9.2.0 cited