2016-04-06 15 views
5

Suppongo che si tratti di un problema noto ma poiché ho utilizzato uno script che ha rimosso il postgresql-9.4-postgis-2.1, I ora non riesco a sbarazzarmi di questo errore SQL sotto Debian.

Impossibile accedere al file «$ libdir/PostGIS-2.1» Nessun file o directory

ho fatto le seguenti:

- Remove new unwanted postgresql-9.5-postgis-2.2 package installed 
- Reinstalling postgresql-9.4-postgis-2.1, postgresql-9.4-postgis-scripts and postgis 
- Using SQL: ALTER EXTENSION postgis UPDATE TO '2.1.4' --under postgres user 
- Using SQL: ALTER EXTENSION postgis_topology UPDATE TO '2.1.4' --under postgres user 

E SELECT * FROM pg_available_extensions; rendimenti

[...] 
postgis 2.1.4 2.1.4 PostGIS geometry, geography, and raster spatial types and functions. 

Ma ancora questo messaggio quando si accede a oggetti come tabelle che utilizza ge tipo ometry.

Qualche idea?

risposta

5

Infine "risolvere" la questione compilazione dai sorgenti PostGIS 2.2.2 (che richiede anche GDAL, Proj4 e GEOS) e quindi l'emissione di

CREATE EXTENSION postgis; 
CREATE EXTENSION postgis_topology; 

dal DROP EXTENSION postgis; dice mi PostGIS non era presente più.

E infine:

ALTER EXTENSION postgis UPDATE TO '2.2.2'; 
ALTER EXTENSION postgis_topology UPDATE TO '2.2.2'; 

Got accesso ancora una volta i miei dati geom e le funzioni da PostgreSQL 9.4. Sembra che la compilazione da sorgente abbia aggiornato correttamente il percorso della variabile per postgresql e installato /usr/lib/postgresql/9.4/lib/postgis-2.2.so che non era più presente (anche per postgis-2.1.so), anche con (ri) installazione da apt-get.

Spero che questo possa essere d'aiuto.

+0

ALTER EXTENSION postgis UPDATE A '2.2.2'; non ha funzionato per me, bu ALTER EXTENSION postgis UPDATE; fatto –

0

Prima esecuzione (come amministratore Postgres)

ALTER EXTENSION postgis UPDATE; 

Se questo ritorna con successo, quindi verificare quale versione avete

SELECT PostGIS_Full_Version(); 

Se, tuttavia, il server restituisce che non riesce a trovare il postgis estensione, quindi eseguire

CREATE EXTENSION postgis; 
CREATE EXTENSION postgis_topology; 
ALTER EXTENSION postgis UPDATE; 

e verificare di nuovo eseguendo

SELECT PostGIS_Full_Version();