-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make probe-readiness.sh use variables for DB_USER and DB_NAME
- Loading branch information
1 parent
702c1bb
commit ce8b391
Showing
1 changed file
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
#!/bin/bash | ||
|
||
PGPASSWORD="$DB_PASSWORD" /usr/pgsql-13/bin/psql -h localhost -p 5432 -U postgres -c "select 1 as psql_is_ready" 2>/dev/null | grep "psql_is_ready" | ||
# Note: host and port should remain localhost and 5432 because | ||
# those represent the location of pgbouncer itself, not the | ||
# remote psql server that would have $DB_HOST:$DB_PORT. | ||
|
||
PGPASSWORD="$DB_PASSWORD" /usr/pgsql-13/bin/psql \ | ||
-h localhost -p 5432 -U "${DB_USER}" -d "${DB_NAME}" \ | ||
-c "select 1 as psql_is_ready" 2>/dev/null \ | ||
| grep "psql_is_ready" | ||
exit $? | ||
|