Search code examples
postgresqlgeolocationpostgisgeoserver

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


Solution

  • 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.