-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keg-only PostgreSQL is incompatible with extensions like PostGIS #179439
Comments
I think that the path forward may be to make PostgreSQL formulae not keg-only but also to include versioned executables (like |
There's ongoing work on this at #167634 -- it sounds similar to the approach you're proposing. |
I've tried this before but it impacts too much existing tooling/users. In current state, removing Only way forward I see for non- The goal of #167634 is to hack around the user voiced requirements like
Anyways, my plan is to try to introduce some modifications like #167634 with PostgreSQL 17. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Summary
The
postgresql@16
formula looks for extension files in directories like/opt/homebrew/opt/postgresql@16/lib
. Extensions like PostGIS cannot install files into these directories (correctly) due to the Homebrew sandbox. As a result, keg-only PostgreSQL formulae likepostgresql@16
are inherently incompatible with extensions.This is a blocker for upgrading the default PostgreSQL version (as suggested in discussions like #5244), and has not been identified as an issue in discussions on workarounds for installing PostGIS for alternate PostgreSQL versions (like #3987).
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew config
:brew doctor
:Verification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I want to use a version of PostgreSQL other than PostgreSQL 14 with extensions such as PostGIS.
What happened (include all command output)?
PostgreSQL looks in several directories for extensions, including a
--libdir
(for.a
files),--pkglibdir
(for.dylib
files), and--sharedir
(for.sql
and.control
) files.In the
postgresql@14
formula (which is not keg-only), these directories are under$HOMEBREW_PREFIX
:This means that when
postgis
is installed and linked into$HOMEBREW_PREFIX
, files like/opt/homebrew/opt/postgis/share/postgresql@14/extension/postgis_topology--3.4.2.sql
are visible at paths like/opt/homebrew/share/postgresql@14/extension/postgis_topology--3.4.2.sql
.Newer PostgreSQL formulae like
postgresql@16
are keg-only, so they look for extensions within their opt prefix:As a result, it is impossible to use any extensions with the
postgresql@16
formula as designed, because if (e.g.) thepostgis
formula tries to install files into/opt/homebrew/opt/postgresql@16/lib
the Homebrew sandbox will rightfully stop it. And because PostgreSQL cannot look in multiple directories for extensions, there appears to be no easy way around this.What did you expect to happen?
I expected
postgresql@16
to locate thepostgis
extension I installed.Step-by-step reproduction instructions (by running
brew
commands)Meanwhile,
postgresql@14
isn't keg-only and as a result can findpostgis
:Note that the installation directories don't quite line up; the
[email protected]
formula I've created gets installed to/opt/homebrew/lib/postgresql@16
and/opt/homebrew/share/postgresql@16
, but thepostgresql@16
formula (if it were linked into the$HOMEBREW_PREFIX
, which it is not) would be looking in/opt/homebrew/lib
,/opt/homebrew/lib/postgresql
, and/opt/homebrew/share/postgresql@16
instead. However, this is irrelevant becausepostgresql@16
isn't looking for extensions anywhere outside of its opt prefix regardless.The text was updated successfully, but these errors were encountered: