Re: proposal: schema variables - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: schema variables
Date
Msg-id CAFj8pRAy7KxMOJKcuqHQZJH2DOh2r7KmcBfh9FgAmw5gC95-SA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: schema variables  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
Hi

út 27. 8. 2024 v 16:52 odesílatel Laurenz Albe <laurenz.albe@cybertec.at> napsal:
time""On Tue, 2024-08-27 at 08:52 +0200, Pavel Stehule wrote:
> I can throw 200KB from another 300KB patch set which can be better for review, but it
> can be harder to maintain this patch set. I'll try it, and I'll send a reduced version.

That was not a criticism, and I think the way you split up the patch set right now
is as good as it probably gets.  Ideally, one could say something like "we need at least
patch 1 to 4, 5 and 6 are optional, but desirable, all others can easily be deferred
to a later time".

It was mentioned here more times (I thought).

1..4 are fundamental
5..6 optional (6 are just tests)

others can be deferred (5-6 can be deferred too). Without support of temporary session variables, it  is not too probable to repeatedly CREATE, DROP the same variable in one session, so memory usage can be similar to today's workarounds, but against workarounds, session variables use types and access rights. Note - plpgsql doesn't try to delete compiled code from cache immediately too - so the behaviour implemented in 1..4 is "similar" to plpgsql func cache

14 .. allow you to use session variables as arguments of CALL or EXECUTE statement, and variables can be used in plpgsql simple expr.
15 .. variables don't block parallelism
16 .. the result of plpgsql simple expr can be assigned to session variables
17 .. expr with session variable can be inlined in SQL

14-17 are performance related

7 - was requested by some people - some functionality can be possibly replaced by plpgsql_check.
It has only 40 rows - it just raise warning or error when some conditions are true

Regards

Pavel

 

Yours,
Laurenz Albe

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch
Next
From: Pavel Stehule
Date:
Subject: Re: [PATCH] Add CANONICAL option to xmlserialize