Skip to content

Commit a5e3573

Browse files
committed
test
1 parent 67781c2 commit a5e3573

File tree

1 file changed

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

1 file changed

+11
-2
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,11 @@ function initiate_upgrade {
308308

309309
echo "7. Disabling extensions and generating post-upgrade script"
310310
handle_extensions
311+
312+
# TODO: Only do postgres <-> supabase_admin swap if upgrading from postgres
313+
# as bootstrap user to supabase_admin as bootstrap user.
311314

312315
echo "8. TODO"
313-
echo "local all all trust
314-
$(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf
315316
run_sql -c "alter role postgres superuser;"
316317
run_sql -c "create role supabase_tmp login superuser;"
317318
psql -h localhost -U supabase_tmp -d postgres "$@" <<-EOSQL
@@ -370,6 +371,14 @@ EOSQL
370371
su -c "$PGBINNEW/initdb -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres
371372
fi
372373

374+
# TODO: Make this declarative, replace file with the most up to date content
375+
# of pg_hba.conf.j2. Otherwise we'd need to supply the password for
376+
# supabase_admin, because pg_upgrade connects to the db as supabase_admin
377+
# using unix sockets, which is gated behind scram-sha-256 per the current
378+
# pg_hba.conf.j2.
379+
echo "local all all trust
380+
$(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf
381+
373382
UPGRADE_COMMAND=$(cat <<EOF
374383
time ${PGBINNEW}/pg_upgrade \
375384
--old-bindir="${PGBINOLD}" \

0 commit comments

Comments
 (0)