16

I installed Postgres on a Windows machine, downloaded the binary installer for PostGIS and installed it. I only have one version of Postgres, so there is no messing up possible.

Installing PostGIS using the binary installer is straight forward and you cannot mess up the installation directory either. it has to go into the Postgres directory.

Now, when I want to create the PostGIS extension I am getting the following error:

ERROR:  could not open extension control file "C:/APPS/POSTGR~1/pg96/../pg96/share/postgresql/extension/postgis.control": No such file or directory
********** Error **********

ERROR: could not open extension control file "C:/APPS/POSTGR~1/pg96/../pg96/share/postgresql/extension/postgis.control": No such file or directory
SQL state: 58P01

Though when I go into the directory C:\APPS\PostgreSQL\pg96\share\extension then I do have a postgis.control file present.

How do I get the extension to work? I checked the content of the zipped PostGIS binaries and it looks like as if the structure is well preserved and all files are copied into the appropriate directories during the install process via the binary installer.

TomGeo
  • 1,213
  • 2
  • 12
  • 24
  • Did you figure it out? I have the same issue, postgres 9.6 and postgis-bundle-pg96x64-setup-2.3.2-1 installer. – LKallipo Jul 19 '17 at 10:28
  • TomGeo could you accept my answer? It seems that it still describes the proper way to go with the matter – LKallipo Sep 27 '18 at 07:57

1 Answers1

27

It seems that the case is still the same with latest versions of postgres (PostgreSQL-9.6.3-1-win64-bigsql.exe) and postgis (postgis-bundle-pg96x64-setup-2.3.2-1.exe). I copied the files around until all the paths could be resolved:

  1. Everything from C:\PostgreSQL\pg96\share\extension to C:\PostgreSQL\pg96\share\postgresql\extension
  2. postgis_topology-2.3.dll, postgis-2.3.dll, rtpostgis-2.3.dll, address_standardizer-2.3.dll and ogr_fdw.dll from C:\PostgreSQL\pg96\lib to C:\PostgreSQL\pg96\lib\postgresql
LKallipo
  • 790
  • 10
  • 18
  • This solution fixed it for me with pg10 on Windows 7. Thanks. – Liam Mitchell Oct 12 '17 at 11:31
  • 3
    This solution work for me in Windows 10 postgres 9.6 and postgis 2.4. Thanks – Figa17 Dec 14 '17 at 18:30
  • You are the hero! worked for me Windows 10, postgres 10.5-1 and "POSTGIS="2.5.0 r16836" [EXTENSION] PGSQL="100" GEOS="3.7.0-CAPI-1.11.0 3.7.0" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.4, released 2018/03/19 GDAL_DATA not found" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER" – codebusta Oct 17 '18 at 10:32
  • 2
    how about centos? i have the same issue – Micheal Toru Feb 25 '20 at 12:16