From 88fe0d64117807fb683ce50f37666cecb4e4458c Mon Sep 17 00:00:00 2001 From: Igor Artemenko Date: Mon, 20 Mar 2023 22:51:05 +0000 Subject: [PATCH] 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. --- install/assets/functions/10-db-backup | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/assets/functions/10-db-backup b/install/assets/functions/10-db-backup index 29f6615..22cdaba 100644 --- a/install/assets/functions/10-db-backup +++ b/install/assets/functions/10-db-backup @@ -437,8 +437,7 @@ check_availability() { ;; "pgsql" ) counter=0 - export PGPASSWORD=${DB_PASS} - until pg_isready --dbname=${DB_NAME} --host=${DB_HOST} --port=${DB_PORT} --username=${DB_USER} -q + until pg_isready --host=${DB_HOST} --port=${DB_PORT} -q do sleep 5 (( counter+=5 ))