1

What I do:

Windows 7, Pgadmin, I select my database, go to extensions, select "New Extension", select "postgis" from List. Then, I get: "An error has appeared: Error: could not load library: C:/Program Files/PostgreSQL/9.4./lib/postgis-2.1.dll". However, when I look into this folder, the file definitely exists.

What can be the problem?

2

That error is caused by a dependency library issues. Is often caused by

1) when you installed not all files were overwritten. You should have gotten an error during install, that some files in use, if that is the case

2) You installed the wrong PostGIS version. E.g. you installed 64-bit version when you are running PostgreSQL 32-bit or 32-bit when you are on PostgreSQL 64-bit. Which version did you install? Did you get it from stackbuilder

3) I screwed up on packaging and missed adding a file you need. Likely culprit is libxml2-2.dll (verify you have that). EDB sometimes changes the name so I may have missed packaging thinking they included it already.

4) Your installed teh wrong PostGIS e.g. installed 2.1.8 for 9.3 instead of 9.4 for example, you have a really old micro version of PostgresQL

verify with

SELECT version();

You should be running 9.4.4 or 9.4.5 to be safe.

  • I install both from a file with the name postgresql-9.4.0-1-windows-x64.exe, which means, I select to install postgis beside postgres during the installation process. It is postgres 9.4 and postgis 94.2.2.0 – Ferenjito Nov 3 '15 at 15:00
  • 1
    Hmm I would upgrade to 9.4.5 as it's possible they made a change in 9.4.1+ that is incompatible with 9.4.0 and I compiled against 9.4.5. You also want to be very careful you picked the PostGIS 9.4 64-bit package. Unfortunately for 64-bit it shows both the 32-bit and 64-bit package since 64-bit installs may have a 32-bit postgres. so really easy to screw up and pick the wrong one. – LR1234567 Nov 3 '15 at 15:40

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.