1

I'm currently running into a problem on pgAdmin 4 where I am unable to use the PostGIS extension. I first tried running it this way through PGAdmin 4:

DROP EXTENSION IF EXISTS postgis CASCADE;
CREATE EXTENSION postgis;
SELECT postgis_full_version();

This gives me this result in messages tab:

ERROR:  could not open extension control file "/Library/PostgreSQL/13/share/postgresql/extension/postgis.control": No such file or directory
SQL state: 58P01

I looked in my 'library/PostgreSQL/13/share/postgresql/extensions' folder and I don't find postgis.control file. I have also downloaded postgres.app and I would have thought this would solve my problem but it still does not appear there.

What might I be able to do so that the extension appears in the extensions folder?

4
  • What kind of Postgresql13/Postgis installation do you use? Depending on the way you install Postgis, the location of the libraries can differ. MacPorts (I prefer this way) resides in /opt/local for example. Homebrew uses /usr/local and Postgres.app may be too.
    – huckfinn
    Dec 5, 2021 at 17:54
  • @huckfinn i installed postgresql13 using this postgresql.org
    – Felix Chan
    Dec 7, 2021 at 23:54
  • Have you installed postgis?
    – huckfinn
    Dec 8, 2021 at 16:07
  • I have tried using homebrew, but it doesn't seem to appear. I had also tried using stack overflow, but when I run stack overflow the application just becomes non responsive
    – Felix Chan
    Dec 9, 2021 at 8:53

1 Answer 1

0

I had it easy when I installed postgres using homebrew.

brew install postgres

Then also use homebrew to install postgis: brew install postgis

This is what was missing

Afterwards, log in to the database with gis requirements:

psql postgres

Then from with psql shell

\c <database_name>

CREATE EXTENSION postgis; \q to exit the shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.