![]() Pg_restore -d gis -clean -if-exists /opt/backups/restore. #psql gis -c "CREATE EXTENSION IF NOT EXISTS addressing_dictionary " Like this: docker run -d -name some-postgres -e POSTGRESPASSWORDmysecretpassword -e POSTGRESUSERsimha -e POSTGRESDBbtgapp postgres:11-alpine. Psql gis -c "CREATE EXTENSION IF NOT EXISTS fuzzystrmatch " Add to that, that the database and user that you want created on startup - can be handled in the environment variables alone for the official postgres image. While running PostgreSQL image it says server not started how we can execute script only after the PostgreSQL server starts in docker container. Second option is to stop the container and relaunch with new DBNAME, DBUSER and other parameters. I have extended PostgreSQL image and able to create new DB instance while running the image.I need to create tables in that DB from shell script that will execute. Psql gis -c "CREATE EXTENSION IF NOT EXISTS postgis " pascalandy docker-postgresql allows you to create multiple database by specifying a comma separated list of database in DBNAME.However only a single user will be granted access to all the database. RUN chmod +x /usr/local/bin/stolon-keeper /usr/local/bin/stolon-sentinel /usr/local/bin/stolon-proxy /usr/local/bin/stolonctl /docker-entrypoint-initdb.d/10_postgis.sh /usr/local/bin/update-postgis.sh initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.shĬOPY -from=builder /stolon/bin/ /usr/local/bin Postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ĬOPY. Postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ & apt-get install -y -no-install-recommends \ If you put a CREATE DATABASE statement at the top of your actual SQL script, but dont supply POSTGRESDB, it will use the POSETGRESUSER as the DB name so the. & apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ I’ve created my stolon image with make PGVERSION=10 TAG=ieud:pg11 dockerĮNV POSTGIS_VERSION 2.5.5+dfsg-1.pgdg90+2 Template1 | stolon | UTF8 | en_US.utf8 | en_US.utf8 | =c/stolon + For production, you need to use a powerful database like PostgreSQL. Template0 | stolon | UTF8 | en_US.utf8 | en_US.utf8 | =c/stolon + Docker is a way to create an isolated environment. Postgres | stolon | UTF8 | en_US.utf8 | en_US.utf8 | Name | Owner | Encoding | Collate | Ctype | Access privileges Plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language ![]() When i access the instance with psql i get this results: \dx And also i’ve changed deployment and statefulset yamls images. The problem is initdb-postgis.sh not executed in stolon cluster so there’s no database named gis and also extensions not enabled. Hi I’m trying to enable PostGIS extension in kubernetes stolon cluster. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |