Search code examples
windowspostgresqlpostgis-installation

Error adding PostGIS extension to PostgreSQL - Win10


When using CREATE EXTENSION postgis; I get the following error message:

ERROR:  could not load library "C:/Program Files/PostgreSQL/11/lib/rtpostgis-2.5.dll": The specified module could not be found. SQL state: XX000
  • System: Windows 10-64bit Home.
  • Postgre SQL installed from 'postgresql-11.5-1-windows-x64.exe'.
  • Postgis installed from 'postgis-bundle-pg11x64-setup-2.5.2-1.exe' (tried also version 2.5.1-1). It does not matter whether I install PostGIS via Application Stack Builder or directly using the installer.

I Tried to create the extension both from pgAdmin 4 context-menu and SQL command as well as command-line via psql.


Solution

  • as per https://trac.osgeo.org/postgis/ticket/4482 - followed the procedure and it fixed the problem (for me).

    • go to your PostgreSQL /postgisgui folder - in my case "C:\Program Files\PostgreSQL\11\bin\postgisgui"
    • manually copy "libeay32.dll" and "ssleay32.dll"
    • paste into the parent "bin" folder

    When restarted pgAdmin, was able to create the postgis extension on selected database.