Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL
Date
Msg-id CAH2-Wzn=MOyxGpDspEKk-uiPMft3J3RSLsaF8gv8Xh6GqnmZVA@mail.gmail.com
Whole thread Raw
In response to Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL  (Bryn Llewellyn <bryn@yugabyte.com>)
Responses Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL  (Bryn Llewellyn <bryn@yugabyte.com>)
List pgsql-general
On Fri, Dec 17, 2021 at 11:43 AM Bryn Llewellyn <bryn@yugabyte.com> wrote:
> Modular design recommends exposing functionality through a purpose oriented interface and hiding all implementation
detailsfrom the API’s user. A package achieves this with declarative syntax via the spec/body separation. The body
encapsulatesas many (top-level) subprograms as you want. Each of these is visible to all of its peers. But none is
visibleoutside of the package unless the spec declares that it should be. This is a simple opt-in scheme. 

I still don't get it. It sounds like you're mostly talking about
encapsulation, or Information hiding, for stored procedures. I can
certainly see how plpgsql doesn't do those things very well, but it
still seems like there might be a lot of nuance that isn't getting
across. The list of specific features that seem to be missing are not
unreasonable, individually, and yet it feels like I cannot see some
bigger picture that's apparent to you.

Maybe you should explain your position by way of a motivating example,
involving a real world use case. Something that makes the issues
concrete. Are these items compelling because of how they allow an
organization to deploy a program in a production environment, complete
with version control? Does it have something to do with decoupling the
mutable business data stored in tables from the programs contained/run
in the same database?

--
Peter Geoghegan



pgsql-general by date:

Previous
From: Bryn Llewellyn
Date:
Subject: Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL
Next
From: Bryn Llewellyn
Date:
Subject: Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL