File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
ansible/files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -310,14 +310,16 @@ function initiate_upgrade {
310
310
handle_extensions
311
311
312
312
echo " 8. TODO"
313
- # run_sql -c "ALTER USER postgres WITH SUPERUSER;"
314
- run_sql << -EOSQL
313
+ run_sql -c " alter role postgres superuser;"
314
+ run_sql -c " create role supabase_tmp login superuser;"
315
+ psql -h localhost -U supabase_tmp -d postgres " $@ " << -EOSQL
315
316
begin;
316
317
alter role postgres rename to supabase_admin_;
317
318
alter role supabase_admin rename to postgres;
318
319
alter role supabase_admin_ rename to supabase_admin;
319
320
commit;
320
321
EOSQL
322
+ run_sql -c " drop role supabase_tmp;"
321
323
322
324
if [ -z " $IS_NIX_UPGRADE " ]; then
323
325
if [ -d " /usr/share/postgresql/${PGVERSION} " ]; then
@@ -372,6 +374,7 @@ EOSQL
372
374
--new-bindir=${PGBINNEW} \
373
375
--old-datadir=${PGDATAOLD} \
374
376
--new-datadir=${PGDATANEW} \
377
+ --username=supabase_admin \
375
378
--jobs="${WORKERS} " -r \
376
379
--old-options='-c config_file=${POSTGRES_CONFIG_PATH} ' \
377
380
--old-options="-c shared_preload_libraries='${SHARED_PRELOAD_LIBRARIES} '" \
You can’t perform that action at this time.
0 commit comments