postgis / docker-postgis

Docker image for PostGIS
https://hub.docker.com/r/postgis/postgis/
MIT License
1.37k stars 462 forks source link

function addgeometrycolumn does not exist ??? incomplete container image? #245

Closed klauskobald closed 3 years ago

klauskobald commented 3 years ago

I am running this command inside the container to import a previously converted shapefile: psql -d gis -f water-polygons-split-4326/water_polygons.sql and get: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist ERROR: current transaction is aborted

what am I doing wrong?

ImreSamu commented 3 years ago

what am I doing wrong?

please give more info:

Maybe just a CREATE EXTENSION IF NOT EXISTS postgis; is missing?

klauskobald commented 3 years ago

yes, I ran this on the db CREATE EXTENSION IF NOT EXISTS postgis; and now the import did work! Schema | Name | Type | Owner | Persistence | Size | Description --------+-----------------+-------+----------+-------------+---------+------------- public | spatial_ref_sys | table | postgres | permanent | 6976 kB | public | water_polygons | table | postgres | permanent | 1049 MB | (2 rows)

I wonder, why that is not contained in the sql file. but good to know!