From: Mladen Gogala <gogala.mladen@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL
Date: Thu, 16 Dec 2021 21:38:55 -0500
Message-ID: <b25c28a4-aaea-ee10-0eba-d9959965fb09@gmail.com> (raw)
In-Reply-To: <CAFj8pRDUysH+a4uuh2c5OHOWhE+RejDvK=dvV6yBdmNOq=Hsng@mail.gmail.com>
References: <48A5C07D-6A66-4B96-A48C-75C530CB9DCF@yugabyte.com>
<CAFj8pRDUysH+a4uuh2c5OHOWhE+RejDvK=dvV6yBdmNOq=Hsng@mail.gmail.com>
On 12/16/21 16:48, Pavel Stehule wrote:
> I don't think Postgres needs packages - this is a redundant concept in
> Postgres, when Postgres has schemas (different from Oracle's schemas)
> and extensions.
>
Yes, ORAFCE uses schemas as the package names. However, one very
practical thing is missing: session variables. Yes, you can emulate
those with ON COMMIT PRESERVE ROWS temporary tables, but that's a rather
ugly hack.
On the other hand, packages can easily be emulated by using Python.
Having packages would make PLPg/SQL programming much prettier. It would
be much prettier to group related routines into a package than to have
them laying around without anything indicating that the routines are
related. On the plus side, packages would make it much easier to migrate
from Oracle to Postgres. And you do want that, don't you?
I am very well aware of the animosity toward the Oracle community and
the reasons for that animosity. Oracle wiped the floor with the
predecessor of Postgres, the database called "Ingres". Sandra Kurtzig,
the Ingres CEO at the the time, and Michael Stonebraker were both
involved in very public spat with Larry Ellison. Stonebraker is still
very much a factor in Postgres community and I doubt that his feelings
toward the Larry and his company have got any warmer with years.
Postgres was created with the idea of fighting the Dark Lord in the land
of Belmont, CA. However, if it is the goal of the community to have
users convert from Oracle to Postgres, than making that conversion easy
would be conducive to that goal. A long time ago a former pastry baker
wrote the following article:
https://www.toolbox.com/tech/data-management/blogs/why-postgresql-doesnt-have-query-hints-020411/
Disclosure: I am the Oracle DBA that Josh Berkus is talking about in
that article. Recent events with "advice" to a very well known Oracle
personality testify to the fact that the emotions haven't changed much
since that article was written. Of course, Oracle is still the most
popular database in the world.
--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: gogala.mladen@gmail.com
Subject: Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL
In-Reply-To: <b25c28a4-aaea-ee10-0eba-d9959965fb09@gmail.com>
References: <48A5C07D-6A66-4B96-A48C-75C530CB9DCF@yugabyte.com> <CAFj8pRDUysH+a4uuh2c5OHOWhE+RejDvK=dvV6yBdmNOq=Hsng@mail.gmail.com> <b25c28a4-aaea-ee10-0eba-d9959965fb09@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox