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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: 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-28 13:12:39
Message-ID: CAFj8pRAnFf6LfCfntXfC=4=t=ZXqJfuEpS6B7956jWW9wDZsVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ne 28. 3. 2021 v 14:45 odesílatel Joel Jacobson <joel(at)compiler(dot)org> napsal:

> On Sun, Mar 28, 2021, at 14:27, Pavel Stehule wrote:
>
> ne 28. 3. 2021 v 13:49 odesílatel Joel Jacobson <joel(at)compiler(dot)org>
> napsal:
>
> It would of course be a problem since other plpgsql extensions could be in
> conflict with such a label,
> so maybe we could allow creating a new language, "plmycorp", using the
> same handlers as plpgsql,
> with the addition of a hard-coded #ROUTINE_LABEL as a part of the language
> definition,
> which would then be forbidden to override in function definitions.
>
>
> There is no technical problem, but if I remember well, the committers
> don't like configuration settings that globally modify the behaviour. There
> can be a lot of issues related to recovery from backups or porting to
> others systems. Personally I understand and I accept it. There should be
> some press for ensuring some level of compatibility. And can be really
> unfanny if you cannot read routine from backups because you have "bad"
> postgres configuration. It can work in your company, but this feature can
> be used by others, and they can have problems.
>
>
> I also dislike configuration that modify behaviour, but I don't think
> that's what I proposed. Creating a new language would not be configuration,
> it would be part of the dumpable/restorable schema, just like the functions.
>

Maybe I don't understand your proposal well, I am sorry. Creating your own
language should not be hard, but in this case the plpgsql is not well
extendable. The important structures are private. You can do it, but you
should do a full copy of plpgsql. I don't think so you can reuse handler's
routines - it is not prepared for it. Unfortunately, the handler expects
only function oid and arguments, and there is not a possibility how to pass
any options (if I know).

Regards

Pavel

>
> /Joel
>
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2021-03-28 13:22:07 Re: [PATCH] Hooks at XactCommand level
Previous Message Andrew Dunstan 2021-03-28 13:07:19 Re: [Proposal] Global temporary tables