问题
Good morning, Collective Intelligence.
I've recently had to resurrect a postgresql-9.1 database by plugging the raw data directory files into a fresh install. All my data is intact, except I can't open up my PostGIS spatial data.
I'm able to enable spatial data on new databases with:
CREATE extension postgis;
However, trying to access data in the recovered spatial databases results in an error.
For example,
SELECT PostGIS_full_version();
throws an error:
ERROR: could not access file "$libdir/postgis-2.0": No such file or directory
SQL state: 58P01
Context: SQL statement "SELECT postgis_lib_version()"
PL/pgSQL function "postgis_full_version" line 17 at SQL statement
I've seen this post on the topic, but there's not enough information to solve my problem.
ERROR: could not access file "$libdir/postgis-2.0" postgresapp
This is my PostGIS version:
POSTGIS="2.1.0SVN" GEOS="3.4.1-CAPI-1.8.0 r3892" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.7.3, released 2010/11/10" LIBXML="2.7.8" LIBJSON="UNKNOWN" (core procs from "2.1.0SVN" need upgrade) RASTER (raster procs from "2.1.0SVN" need upgrade)
I'm assuming this is a path variable I need to reset somehow, though I'm not sure how to access it.
Appreciate very much your tips.
Forgot to say: I did check the setting in the pg_config file for the libdir. It's set to usr/lib/postgresql/9.1/lib which is working properly for new databases that I enable. Is there a way to check the setting on the old data? How would it be different? Thx.
回答1:
I installed it 2.1.0SVN a while and resolved the issue without downgrading http://www.lontongcorp.com/?p=783
Basically you need to link
sudo ln -s /usr/lib/postgresql/9.2/lib/postgis-2.1.so /usr/lib/postgresql/9.2/lib/postgis-2.0
sudo ldconfig
回答2:
SOLVED: Some more rooting around led me to the extensions on my PostGIS databases, which I couldn't update to 2.1.0SVN. Re-installing to PostGIS 2.0.3 solved the issue.
回答3:
I had the same problem on debian with postgres 9.3 and postgis 2.1 and i solved it by re-installing the postgis-2.1, now it works properly.
回答4:
I had the same problem after upgrading postgres+postgis via yum.
I solved it by upgrading the databases as mentioned on the postgis website:
-- Upgrade PostGIS (includes raster)
ALTER EXTENSION postgis
UPDATE TO "2.1.4";
-- Upgrade Topology
ALTER EXTENSION postgis_topology
UPDATE TO "2.1.4";
来源:https://stackoverflow.com/questions/19271219/ubuntu-12-04-postgresql-9-1-cant-access-libdir-postgis-2-0