From 16efb8a817a4738e42414be9fe6d856803cf6b34 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 17 Sep 2024 00:53:40 +0100 Subject: [PATCH] fix: schema name escaping --- ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 303544067..a048c9b08 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -341,7 +341,7 @@ begin else obj->>'role' end , case when obj->>'schema' is null then '' - else format('in schema %s', (obj->>'schema')::regnamespace) + else format('in schema %I', obj->>'schema') end , rec.privilege_type , case when obj->>'objtype' = 'r' then 'tables' @@ -369,7 +369,7 @@ begin execute(format('alter default privileges for role %I %s grant %s on %s to %s %s' , obj->>'role' , case when obj->>'schema' is null then '' - else format('in schema %s', (obj->>'schema')::regnamespace) + else format('in schema %I', obj->>'schema') end , rec.privilege_type , case when obj->>'objtype' = 'r' then 'tables'