Skip to content

Commit 88fe0d6

Browse files
committed
Simplify pg_isready usage
The pg_isready documentation says that it does not need a correct database name or username to get the server status. In fact, incorrect values result in the server logging failed connection attempts. As a result, when we set DB_NAME to ALL, calls to the check_availability function (which uses pg_isready) cause the server to log the following error: FATAL: database "ALL" does not exist To eliminate this error, this change simplifies the pg_isready call.
1 parent 366c475 commit 88fe0d6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

install/assets/functions/10-db-backup

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ check_availability() {
437437
;;
438438
"pgsql" )
439439
counter=0
440-
export PGPASSWORD=${DB_PASS}
441-
until pg_isready --dbname=${DB_NAME} --host=${DB_HOST} --port=${DB_PORT} --username=${DB_USER} -q
440+
until pg_isready --host=${DB_HOST} --port=${DB_PORT} -q
442441
do
443442
sleep 5
444443
(( counter+=5 ))

0 commit comments

Comments
 (0)