Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geoserver ERROR: function postgis_lib_version()

in geoserver whene i need to creat a new data store after to creat new workspace, i have this error

Error creating data store, check the parameters. Error message: Unable to obtain connection: ERROR: function postgis_lib_version() does not exist Indice : No function matches the given name and argument types. You might need to add explicit type casts. Position : 8

like image 605
oustyle Avatar asked Jul 27 '16 09:07

oustyle


1 Answers

That error implies that you are attempting to add a PostgreSQL database rather than a PostGIS database. You need to add the PostGIS extension to the database with this command:

psql -d yourdatabase -c "CREATE EXTENSION postgis;"
psql -d yourdatabase -c "CREATE EXTENSION postgis_topology;"

This will then allow you to store geometries (and geographies) in your tables which GeoServer can then display as map layers.

like image 125
Ian Turton Avatar answered Oct 05 '22 04:10

Ian Turton