Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Subject: Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL
Date: 2021-12-20 19:37:44
Message-ID: CAFj8pRC=95QGCFN=nZ6GRb0fOZy7sae9MPwBAkn-vqoVSCBJjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

> I’m still hoping that I might get some pointers to whitepapers or blog
> posts that expand on those bullets that I quoted from the PG doc: «Instead
> of packages, use schemas to organize your functions into groups.» and
> «Since there are no packages, there are no package-level variables either.
> This is somewhat annoying. You can keep per-session state in temporary
> tables instead.»
>

I fixed a patch https://commitfest.postgresql.org/36/1608/ so you can check
it.

Using temporary tables instead of session variables is not too practical.
There are more alternative ways - a) one extension, b) using global
variables from Perl, c) using global configuration variables.

The @c is most common today

http://okbob.blogspot.com/2021/06/calculating-derivation-from.html

Regards

Pavel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matt Magoffin 2021-12-20 20:26:47 Freeing transient memory in aggregate functions
Previous Message Bryn Llewellyn 2021-12-20 19:28:16 Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL