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.


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

  • ... on what operating system and version? Also, please don't edit the error message, can you show the original and the statement you ran to create it, as well as a listing of the location the error refers to? May 15, 2013 at 0:13
  • 1
    Use the Enterprisedb stackbuilder installer it creates postgres database and postgis is an option with built in spatial template enterprisedb.com/products-services-training/products/…
    – Mapperz
    May 15, 2013 at 2:50

1 Answer 1


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.
  • Since our systems are almost the same, it's likely that this guy's solution will work for me too. +1
    – Pavel V.
    May 15, 2013 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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