Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 12.04, PostgreSQL-9.1 - Can't access $libdir/postgis-2.0

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.

like image 475
JMcClure Avatar asked Oct 09 '13 11:10

JMcClure


2 Answers

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
like image 157
lontongcorp Avatar answered Oct 19 '22 00:10

lontongcorp


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.

like image 36
JMcClure Avatar answered Oct 18 '22 22:10

JMcClure