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

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, Chapman Flack <chap(at)anastigmatix(dot)net>, Jack Christensen <jack(at)jncsoftware(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pl/pgsql feature request: shorthand for argument and local variable references
Date: 2021-03-13 11:49:00
Message-ID: 20210313114900.5r6nyjlu4qehxgpc@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 13, 2021 at 12:10:29PM +0100, Pavel Stehule wrote:
>
> so 13. 3. 2021 v 9:53 odesílatel Julien Rouhaud <rjuju123(at)gmail(dot)com> napsal:
> >
> > I don't think that it makes sense to have multiple occurences of this
> > command,
> > and we should simply error out if plpgsql_curr_compile->root_ns->itemno is
> > PLPGSQL_LABEL_REPLACED. If any case this should also be covered in the
> > regression tests.
> >
>
> I did it. Thank you for check

Thanks, LGTM.

> I wrote few sentences to documentation

Great!

I just had a few cosmetic comments:

+ block can be changed by inserting special command at the start of the function
[...]
+ arguments) is possible with option <literal>routine_label</literal>:
[...]
+ errhint("The option \"routine_label\" can be used only once in rutine."),
[...]
+-- Check root namespace renaming (routine_label option)

You're sometimes using "command" and "sometimes" option. Should we always use
the same term, maybe "command" as it's already used for #variable_conflict
documentation?

Also

+ variables can be qualified with the function's name. The name of this outer
+ block can be changed by inserting special command at the start of the function
+ <literal>#routine_label new_name</literal>.

It's missing a preposition before "special command". Maybe

+ variables can be qualified with the function's name. The name of this outer
+ block can be changed by inserting a special command
+ <literal>#routine_label new_name</literal> at the start of the function.

+ The function's argument can be qualified by function name:

Should be "qualified with the function name"

+ Sometimes the function name is too long and can be more practical to use
+ some shorter label. An change of label of top namespace (with functions's
+ arguments) is possible with option <literal>routine_label</literal>:

Few similar issues. How about:

Sometimes the function name is too long and *it* can be more practical to use
some shorter label. *The top namespace label can be changed* (*along* with
*the* functions' arguments) *using the option* <literal>routine_label</literal>:

I'm not a native English speaker so the proposes changed may be wrong or not
enough.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2021-03-13 11:53:30 Re: shared-memory based stats collector
Previous Message Mark Rofail 2021-03-13 11:42:38 Re: [HACKERS] GSoC 2017: Foreign Key Arrays