From 8a46c93e70a933972ebea425c35d8a9f989e24bf Mon Sep 17 00:00:00 2001 From: dmir Date: Thu, 8 Feb 2024 17:32:35 +0300 Subject: [PATCH] Fix --- backup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index 16fa9e1..3e3f7dd 100644 --- a/backup.sh +++ b/backup.sh @@ -100,8 +100,8 @@ case "${PG_BACKUP_ACTION:-dump}" in fi echo "Turning off autovacuum" - psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "ALTER SYSTEM SET autovacuum = off;" - psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "SELECT pg_reload_conf;" + psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "ALTER SYSTEM SET autovacuum = off;" + psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "SELECT pg_reload_conf;" echo "Downloading latest snapshot from $PG_BACKUP_FILE" curl -o dump.backup $PG_BACKUP_FILE @@ -110,7 +110,7 @@ case "${PG_BACKUP_ACTION:-dump}" in pg_restore -v -d $POSTGRES_DB $POSTGRES_HOST_OPTS dump.backup echo "Re-enable autovacuum" - psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "ALTER SYSTEM RESET autovacuum;" - psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "SELECT pg_reload_conf;" + psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "ALTER SYSTEM RESET autovacuum;" + psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "SELECT pg_reload_conf;" ;; esac