Skip to content

Commit 34d2c81

Browse files
committed
fix: only update pg_hba.conf if needed
1 parent 98e9cc5 commit 34d2c81

File tree

1 file changed

+4
-2
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+4
-2
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,11 @@ function initiate_upgrade {
391391
# instance, since pg_upgrade connects to the db as supabase_admin using unix
392392
# sockets, which is gated behind scram-sha-256 per pg_hba.conf.j2. The new
393393
# instance is unaffected.
394-
echo "local all supabase_admin trust
394+
if ! grep -q "local all supabase_admin trust" /etc/postgresql/pg_hba.conf; then
395+
echo "local all supabase_admin trust
395396
$(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf
396-
run_sql -c "select pg_reload_conf();"
397+
run_sql -c "select pg_reload_conf();"
398+
fi
397399

398400
UPGRADE_COMMAND=$(cat <<EOF
399401
time ${PGBINNEW}/pg_upgrade \

0 commit comments

Comments
 (0)