Skip to content

Commit 8ade21a

Browse files
committed
fix: only update pg_hba.conf if needed
1 parent 0775be0 commit 8ade21a

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
@@ -406,9 +406,11 @@ function initiate_upgrade {
406406
# instance, since pg_upgrade connects to the db as supabase_admin using unix
407407
# sockets, which is gated behind scram-sha-256 per pg_hba.conf.j2. The new
408408
# instance is unaffected.
409-
echo "local all supabase_admin trust
409+
if ! grep -q "local all supabase_admin trust" /etc/postgresql/pg_hba.conf; then
410+
echo "local all supabase_admin trust
410411
$(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf
411-
run_sql -c "select pg_reload_conf();"
412+
run_sql -c "select pg_reload_conf();"
413+
fi
412414

413415
UPGRADE_COMMAND=$(cat <<EOF
414416
time ${PGBINNEW}/pg_upgrade \

0 commit comments

Comments
 (0)