File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
ansible/files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ if [ -n "$IS_CI" ]; then
73
73
echo " PGVERSION: $PGVERSION "
74
74
fi
75
75
76
+ OLD_BOOTSTRAP_USER=$( run_sql -A -t -c " select rolname from pg_authid where oid = 10;" )
77
+
76
78
cleanup () {
77
79
UPGRADE_STATUS=${1:- " failed" }
78
80
EXIT_CODE=${?:- 0}
@@ -314,8 +316,9 @@ function initiate_upgrade {
314
316
315
317
echo " 8. TODO"
316
318
run_sql -c " alter role postgres superuser;"
317
- run_sql -c " create role supabase_tmp login superuser;"
318
- psql -h localhost -U supabase_tmp -d postgres << -EOSQL
319
+ if [ " $OLD_BOOTSTRAP_USER " = " postgres" ]; then
320
+ run_sql -c " create role supabase_tmp login superuser;"
321
+ psql -h localhost -U supabase_tmp -d postgres << -EOSQL
319
322
begin;
320
323
do $$
321
324
declare
469
472
$$ ;
470
473
rollback;
471
474
EOSQL
472
- run_sql -c " drop role supabase_tmp;"
475
+ run_sql -c " drop role supabase_tmp;"
476
+ fi
473
477
474
478
if [ -z " $IS_NIX_UPGRADE " ]; then
475
479
if [ -d " /usr/share/postgresql/${PGVERSION} " ]; then
You can’t perform that action at this time.
0 commit comments