Ability to reference other extensions by schema in extension scripts

From: "Regina Obe" <lr(at)pcorp(dot)us>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Ability to reference other extensions by schema in extension scripts
Date: 2022-11-10 02:43:43
Message-ID: 003001d8f4ae$402282c0$c0678840$@pcorp.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think I had brought this up a while ago, but I forget what the opinion was
on the matter.

PostGIS has a number of extensions that rely on it. For the extensions that
are packaged with PostGIS, we force them all into the same schema except for
the postgis_topology and postgis_tiger_geocoder extensions which are already
installed in dedicated schemas.

This makes it impossible for postgis_topology and postgis_tiger_geocoder to
schema qualify their use of postgis. Other extensions like pgRouting,
h3-pg, mobilitydb have similar issues.

My proposal is this. If you think it's a good enough idea I can work up a
patch for this.

Extensions currently are allowed to specify a requires in the control file.

I propose to use this information, to allow replacement of phrases

@extschema_nameofextension@ as a variable, where nameofextension has to be
one of the extensions listed in the requires.

The extension plumbing will then use this information to look up the schema
that the current required extensions are installed in, and replace the
variables with the schema of where the dependent extension is installed.

Does anyone see any issue with this idea.

Thanks,
Regina

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-11-10 03:49:30 Re: Ability to reference other extensions by schema in extension scripts
Previous Message Peter Geoghegan 2022-11-10 02:35:12 Re: HOT chain validation in verify_heapam()