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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: 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: 2020-11-19 04:32:30
Message-ID: CAFj8pRATiOfJb32bYx_Q1XALHaveteX3cNh_8OqBniFWUpfCzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

this is less invasive, and probably more correct work with ns items patch.

čt 19. 11. 2020 v 1:54 odesílatel Vik Fearing <vik(at)postgresfriends(dot)org>
napsal:

> On 11/18/20 9:21 PM, Pavel Stehule wrote:
> > postgres=# create or replace function bubu(a int, b int)
> > returns void as $$
> > #routine_label b
> > begin
> > raise notice '% %', b.a, b.b;
> > end;
> > $$ language plpgsql;
>
> Why not use the block labeling syntax we already have?
>
> create or replace function bubu(a int, b int)
> returns void as $$
> << b >>
> begin
> raise notice '% %', b.a, b.b;
> end;
> $$ language plpgsql;
>
> That doesn't currently work, but it could be made to.
>

I don't think it is correct - in your example you are trying to merge two
different namespaces - so minimally it should allow duplicate names in one
namespace, or it breaks compatibility.

And I don't think so we want to lose information and separate access to
function's arguments.

Regards

Pavel

> --
> Vik Fearing
>

Attachment Content-Type Size
plpgsql-routine_label-option-v2.patch text/x-patch 6.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-11-19 05:01:14 Re: Cache relation sizes?
Previous Message Bharath Rupireddy 2020-11-19 04:11:29 Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit