From eea5ee0ff3d00fa3008a82fce2911b529c272265 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 26 Sep 2024 13:53:44 +0100 Subject: [PATCH] fix: account for `public` grantee --- ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh index e978b2a54..4c776844b 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -356,6 +356,7 @@ begin end , case when rec.grantee = 'postgres'::regrole then 'supabase_admin' when rec.grantee = 'supabase_admin'::regrole then 'postgres' + when rec.grantee = 0 then 'public' else rec.grantee::regrole end )); @@ -382,7 +383,7 @@ begin when obj->>'objtype' = 'T' then 'types' when obj->>'objtype' = 'n' then 'schemas' end - , rec.grantee::regrole + , case when rec.grantee = 0 then 'public' else rec.grantee::regrole end , case when rec.is_grantable then 'with grant option' else '' end )); end if;