On Wed, Jun 2, 2021 at 11:32 PM Joel Jacobson <joel@compiler.org> wrote:
On Wed, Jun 2, 2021, at 18:36, Marko Tiikkaja wrote:
The use case is: version upgrades. I want to be able to have a search_path of something like 'pg_catalog, compat, public'. That way we can provide compatibility versions of newer functions in the "compat" schema, which get taken over by pg_catalog when running on a newer version. That way all the compatibility crap is clearly separated from the stuff that should be in "public".
That's a neat trick, probably the best solution in a really old PostgreSQL version, before we had extensions.
But if running a recent PostgreSQL version, with support for extensions, I think an even cleaner solution
would be to package such compatibility versions in a "compat" extension, that would just install them into the public schema.
Writing, verifying and shipping extension upgrade scripts is not pleasant. I'd much prefer something that's integrated to the workflow I already have.
And if you wonder what functions in public come from the compat extension, you can use use \dx+.
They still show up everywhere when looking at "public". So this is only slightly better, and a maintenance burden.