Answer a question

I created a database with docker using the postgres image as usual

docker run -d \       
--name some-postgres \
-e POSTGRES_PASSWORD=mypassword \
-v ${HOME}/postgres-data/:/var/lib/postgresql/data \
-p 5432:5432 \
postgres

now I decided to add a new column in one of the tables to store coordinates using postgis, however when I do

CREATE EXTENSION postgis;

or something similar I get this error message:

ERROR:  could not open extension control file "/usr/share/postgresql/12/extension/postgis.control": No such file or directory

is there an additional step one has to take before running the docker container in order to install postgis?

thanks a lot

Answers

The postgis extension does not come with vanilla postgres, which does ship with a whole bunch of more general purpose extensions, though nothing notable for geospatial. Take a look at this instead: https://registry.hub.docker.com/r/postgis/postgis/

Logo

PostgreSQL社区为您提供最前沿的新闻资讯和知识内容

更多推荐