diff --git a/scripts/setup/postgres-init-db b/scripts/setup/postgres-init-db index 9cecea8be2..66228a0c8b 100755 --- a/scripts/setup/postgres-init-db +++ b/scripts/setup/postgres-init-db @@ -2,6 +2,9 @@ set -e set -x +# What user should we use for connecting to the database +POSTGRES_USER="${POSTGRES_USER:-postgres}" + # Shut down all services to ensure a quiescent state. if [ -e "/var/run/supervisor.sock" ]; then supervisorctl stop all @@ -15,14 +18,14 @@ source "$(dirname "$0")/terminate-psql-sessions" postgres zulip zulip_base # Make sure the current working directory is readable by postgres cd / -su postgres -c psql <