[Gfoss] installazione postgre/postgis su ubuntu 6.10 tramite apt

Buggy Pine buggy.pine at gmail.com
Wed Nov 1 09:51:22 CET 2006


>
> Ciao Giovanni,
> grazie del suggerimento...
> ha funzionato alla perfezione.
> Sono entrato in psql e mi sono connesso a template1 ma il comando
> select postgis_full_version() ha restituito il seguente errore:
>
> ERROR:  function postgis_full_version() does not exist
> HINT:  No function matches the given name and argument types. You may need
> to add explicit type casts.
>

Questo significa che le funzioni e le tabelle di postgis (necessarie
per ogni database) non sono presenti nel database "template1".
Questo non significa necessariamente che PostGIS non sia installato.
Significa che il file di istruzioni lwpostgis.sql (ed
spatial_ref_sys.sql) non sono stati "caricati" in quel db.

Per fare questo:

createlang plpgsql yourtestdatabase
psql -d yourtestdatabase -f lwpostgis.sql
psql -d yourtestdatabase -f spatial_ref_sys.sql

questo lo puoi fare per ogni database che vuoi "abilitare" a postgis,
oppure in un database che tu userai come template (ad esempio template1)

se lo fai per template1 (che postgresql usadi default come template),
ognu nuovo database sarà abilitato a postgis.

nessuno ti vieta però di crearti il "tuo" database di template (ad
esempio geotemplate) dove tu carichi le funzioni di postgis e tutto
quello che vorresti già fatto in un nuovo database.
In questo modo:

createdb geotemplate
createlang plpgsql geotemplate
psql -d geotemplate -f lwpostgis.sql
psql -d geotemplate -f spatial_ref_sys.sql

psql -d geotemplate -f
altre_istruzioni_per_funzioni_o_tabelle_che_uso_sempre.sql

ora geotemplate lo puoi usare cometemplate per i tuoi database postgis.
per fare questo, quando crei un nuovo database basta:

createdb nuovo_postgis_db -T geotemplate


L'installer di windows per postgresql (se abiliti postgis) mette di
default le funzioni(e tabelle) di postgis in template1


Spero questo ti sia d'aiuto...

Ciao
Ruggero



More information about the Gfoss mailing list