From aeadcac26f9d05321219459e0d084d320c7563ed Mon Sep 17 00:00:00 2001 From: Soksamnang Lim Date: Tue, 31 Oct 2023 18:34:07 -0700 Subject: [PATCH] fix get_show_grant_sql macro --- dbt/include/redshift/macros/adapters/apply_grants.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbt/include/redshift/macros/adapters/apply_grants.sql b/dbt/include/redshift/macros/adapters/apply_grants.sql index ed51aaa2a..c6dedfa3f 100644 --- a/dbt/include/redshift/macros/adapters/apply_grants.sql +++ b/dbt/include/redshift/macros/adapters/apply_grants.sql @@ -74,6 +74,7 @@ where exists( select * from information_schema.table_privileges tp where tp.grantee=g.groname + and tp.table_schema=replace(split_part('{{ relation }}', '.', 2), '"', '') and tp.table_name=replace(split_part('{{ relation }}', '.', 3), '"', '') and LOWER(tp.privilege_type)=p.privilege_type ) @@ -90,6 +91,7 @@ where exists( select * from svv_relation_privileges rp where rp.identity_name=r.role_name + and rp.namespace_name=replace(split_part('{{ relation }}', '.', 2), '"', '') and rp.relation_name=replace(split_part('{{ relation }}', '.', 3), '"', '') and LOWER(rp.privilege_type)=p.privilege_type )