2

I have a university project in which I continue a project of last year. I never used those tool and I'm getting the following error:

ERREUR:  n'a pas pu accéder au fichier « $libdir/postgis-2.1 » : No such file or directory

I download PostgreSQL 9.5 and PostGIS 2.2.1 with stack builder on windows, and try to restore first a "Dump_Dabatase_Structure.sql" and then "Dump_Dabatase_Data.sql" but got the error when trying to restore the structure

EDIT: I deleted postgis with the uninstaller because your command said me i didnt have the postgis extension and used your installer but now im getting:

ERREUR: n'a pas pu charger la bibliothèque « C:/Program Files/PostgreSQL/9.5/lib/postgis-2.1.dll » : unknown error 127
********** Erreur ********** 
ERREUR: n'a pas pu charger la bibliothèque « C:/Program Files/PostgreSQL/9.5/lib/postgis-2.1.dll » : unknown error 127 
État SQL :XX000
  • Just to clarify, you're saying you haven't previously used PostgreSQL/PostGIS in your work, but you are trying to use a previous person's work by restoring their database? Can you also post the command you use for the restore, or are you simply executing the .sql script? – raphael Feb 7 '16 at 20:58
  • what i mean is that in my university in the 3rd years, you have a group project on some new technologie. My project is based on some other group work from last yeats where i need to add function to an android app that manage a grocery list and have a function to find shop nearby with a server to use REST api. I have nerver worked with a database , android, or REST api. I didnt used a command for now beside double cliking the .sql dum file and load it on pgAdmin where the error appear – Serk Feb 7 '16 at 21:52
2

The error you're getting is because you're trying to restore a database created with an old version of PostGIS (2.1) to a newer version (2.2).

I would recommend trying to downgrade your PostGis version to 2.1.x by using the following command in your database, assuming you have no data loaded in it (Please backup your current DB if you do!)

DROP EXTENSION postgis;
DROP EXTENSION postgis_topology;

And then running the postgis-bundle-pg94x64-setup-2.1.8-1.exe installer (if your Windows is 64-bit) from here

  • i deleted postgis with the uninstaller because your command said me i didnt have the postgis extension and used your installer but now im getting: ERREUR: n'a pas pu charger la bibliothèque « C:/Program Files/PostgreSQL/9.5/lib/postgis-2.1.dll » : unknown error 127 ********** Erreur ********** ERREUR: n'a pas pu charger la bibliothèque « C:/Program Files/PostgreSQL/9.5/lib/postgis-2.1.dll » : unknown error 127 État SQL :XX000 – Serk Feb 7 '16 at 22:36
  • 1
    Hi your comment got cut off. Feel free to edit your original question to add more details – raphael Feb 7 '16 at 23:27
  • Hi @Serk, are you using Windows 7? What command did you run to get the error you mentioned? Have you tried running the CREATE EXTENSION ... commands in pgadmin? (see stackoverflow.com/questions/29685525/…) – raphael Feb 8 '16 at 4:09
  • Sorry, i edited my original question. What i did step by step: launching the windows 10 the terminal with 'cmd', then 'psql -U postgres' and type the 'YOUR COMMENT' but it gave the error, so i used the uninstaller on C:\Program Files\PostgreSQL\9.5, and reinstalled the 2.1 version you linked me and then opened the dump.sql wit pgadmin and press run where it gave me the error – Serk Feb 8 '16 at 6:33
  • After you ran the installer did you run CREATE EXTENSION in pgadmin? Can you see if there's the postgis-2.1.dll in /PostgreSQL/9.4/ folder? – raphael Feb 8 '16 at 6:39

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.