Re: PL/Perl function signatures

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PL/Perl function signatures
Date: 2023-08-29 09:59:53
Message-ID: CAKoxK+4T6nKwPMQs3fsZs6x+RT8GOZtcgOTNRRfqihCMndguwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 28, 2023 at 9:53 AM Luca Ferrari <fluca1978(at)gmail(dot)com> wrote:
>
> testdb=# create or replace function f( a int )
> returns text
> as $$
> use feature 'signatures';

shame on me!
Clearly this cannot work because at the 'use' stage the function is
already running, so the signatures feature is evaluated in the context
of the function itself.
However, this also does not work:

postgres=# alter system set plperl.on_init to 'use feature q/signatures/;';

As far as I understand, the plperl code in plperl.c does the following
for a non-array input parameter:

sv = (SV *) DatumGetPointer(OidFunctionCall1(funcid, fcinfo->args[i].value));

and that does not put the argument name, so it seems to me there is no
way to handle this at the moment.
But that code is too scary for me!

Luca

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Wienhold 2023-08-29 11:22:31 Re: Restoring default privileges on objects
Previous Message David G. Johnston 2023-08-29 05:23:17 Re: Postgres service is not starting