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 08:53:51
Message-ID: 20210313085351.tpvoteozs5lq77na@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think that this can be a useful feature in many occasions, especially since
the overhead is almost inexistent.

The implementation is sensible and there are regression tests to cover the new
feature.

There's a problem however if you try to add multiple #routine_label commands in
the same function. At minimum the Assert on "nse->itemno == (int)
PLPGSQL_LABEL_BLOCK" will fail.

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-03-13 09:54:24 Re: pgbench: option delaying queries till connections establishment?
Previous Message Fabien COELHO 2021-03-13 08:49:53 Re: pgbench - add pseudo-random permutation function