[GIS] PgAdmin cannot load postgis for a database

postgispostgresql

Postgis works fine on my other postgresql databases, but I can't load postgis and postgis_topology extensions on a new database. I get following error message:

ERROR: could not load library (path to PostgreSQL): unknown error 126

Off course I could work in a different database with postgis loaded, but I don't like the idea that my new databases might not support postgis.

How to solve this problem?

I have PostgreSQL 9.2, PostGIS 2.0.1 and PgAdmin III 1.16.

EDIT:

My system is Windows XP SP 2.

And the statement I used:

CREATE EXTENSION postgis SCHEMA topology VERSION "2.0.1";

I have created schema "topology" manually, but it makes the same error for

Best Answer

This looks like more of a database install problem than a GIS issue. For that reason, a quick search on our sister Stackexchange site StackOverflow, turned up this question and series of answers:

Postgres could not load library unknown error 14001

Here is the answer that did the trick: https://stackoverflow.com/a/13513473/1388679

It boils down to an install on a Windows machine that is missing the correct version of Microsoft Visual C++. Since you have not provided that information, this is a bit of a guess, but it seems to match what you are running into.

One other solution also mentioned on that thread would be:

  1. Completely uninstall Postgresql and all of its dependencies.
  2. Make sure that all Windows updates are applied correctly.
  3. Reinstall Postgresql and PostGIS. This would ensure that the correct supporting files are being installed with the database.
Related Question