Skip to content

Commit

Permalink
[FIX] 20-postgres-wait: avoid assuming you have permission to list da…
Browse files Browse the repository at this point in the history
…tabase
  • Loading branch information
vaab committed Sep 14, 2024
1 parent fc5b2c4 commit 7392081
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion entrypoint.d/20-postgres-wait
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ fi

log INFO Waiting until postgres is listening at $PGHOST...
while true; do
psql --list > /dev/null 2>&1 && break
if [ -n "$PGDATABASE" ]; then
echo "SELECT 1;" | psql "$PGDATABASE"
else
# Assumes that your access level to postgres includes the
# right to list databases
psql -l
fi > /dev/null 2>&1 && break
sleep 1
done

0 comments on commit 7392081

Please sign in to comment.