openstreetmap-website/docker/postgres/openstreetmap-postgres-init.sh
Andy Allan 6c5c36deac Automatically enable the btree_gist extension
This simplifies the install instructions. Loading from structure.sql is already handled.
2021-03-10 18:24:36 +00:00

12 lines
450 B
Bash
Executable file

#!/bin/bash
set -ex
# Create 'openstreetmap' user
# Password and superuser privilege are needed to successfully run test suite
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" <<-EOSQL
CREATE USER openstreetmap SUPERUSER PASSWORD 'openstreetmap';
GRANT ALL PRIVILEGES ON DATABASE openstreetmap TO openstreetmap;
EOSQL
# Define custom functions
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -f "/usr/local/share/osm-db-functions.sql" openstreetmap