diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 9babea4..f33ca8c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -579,7 +579,7 @@ _main() { echo "------------------------" # Get the list of databases in the database cluster - DB_LIST=$(echo 'SELECT datname FROM pg_catalog.pg_database WHERE datistemplate IS FALSE' | postgres --single -D /var/lib/postgresql/data 2>/dev/null | grep datname | grep -v backend | cut -d '"' -f 2) + DB_LIST=$(echo 'SELECT datname FROM pg_catalog.pg_database WHERE datistemplate IS FALSE' | postgres --single -D "${PGDATA}" 2>/dev/null | grep datname | grep -v backend | cut -d '"' -f 2) # For each database, reindex it for DATABASE in ${DB_LIST}; do @@ -587,7 +587,7 @@ _main() { echo "Starting reindex of ${DATABASE}" echo "-------------------------------" - echo 'REINDEX DATABASE' | postgres --single -D /var/lib/postgresql/data "${DATABASE}" + echo 'REINDEX DATABASE' | postgres --single -D "${PGDATA}" "${DATABASE}" echo "-------------------------------" echo "Finished reindex of ${DATABASE}"