homebrew-osgeo4mac: I can not install postgis in any of the postgres versions (@ 10 and 11).

_This was originally posted by @miguelangelperg in https://github.com/OSGeo/homebrew-osgeo4mac/issues/769#issuecomment-470257463_


Hi @fjperini, @luispuerto

I can not install postgis in any of the postgres versions (@ 10 and 11).

# select postgis_full_version() ;
ERROR:  could not access file "$libdir/postgis-2.4": No such file or directory
CONTEXT:  SQL statement "SELECT public.postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 25 at SQL statement
# ALTER EXTENSION postgis UPDATE;
ERROR:  could not open extension control file "/usr/local/Cellar/postgresql@10/10.6_1/share/postgresql@10/extension/postgis.control": No such file or directory   

My postgis facilities for almost two years have been obtained from the tap osgeo4mac.

  1. Before the upgrade to qgis 3.4.2 I had in my Cellar: postgis and within postgis the different versions: 2.4.4_1 and the linked 2.5.0. Both versions built against gdal version 2. My GDAL was in my Cellar in the gdal folder. Inside it, were the different versions that had been installed: 2.3.1_1 and 2.3.1_2 (linked). Postgis without problems

I do not know if it’s related, but:

  1. After the upgrade, I keep the previous Cellar, which are still linked. But I also have: postgis2 with version 2.5.1_1 gdal2 with version 2.4.0

If I request: brew uninstall postgis I get:

$ brew uninstall postgis

Error: Refusing to uninstall /usr/local/Cellar/postgis/2.5.0
because it is required by postgis2, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies postgis

I uninstalled postgis, and linked postgis2, but it does not solve anything. I can send details of the experience if it was useful

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 35

Most upvoted comments

We had a related problem that we solved by not using homebrew. We had old postgres/postgis databases that we needed to upgrade to a newer version of postgres. I don’t think this is possible with homebrew because, while postgresql is versioned, postgis is not. I was not able to install an older version of postgis via homebrew.

However, postgres.app made it easy. You can install the multi-version version of postgres.app. All of the versions include postgis. Once installed we were able to open the older data and dump it. Then initialize a newer database and reload.

@fjperini I had thrown it before you asked me to wait Postgis installed on postges11

brew reinstall -s gdal2 postgis2 were allowed to create the extension, finally.

$ psql
psql (11.2)
Type "help" for help.

# create extension postgis;
CREATE EXTENSION
# select postgis_full_version();
                                                                                          postgis_full_version                                                                                          
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="2.5.1 r17027" [EXTENSION] PGSQL="110" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.4.0, released 2018/12/14" LIBXML="2.9.9" LIBJSON="0.13.1" RASTER
(1 row)

@fjperini, You said:

I will need you to help me make a map of all the dependencies and their dependencies.

Of course, you can count on me. Thanks