diff options
-rw-r--r-- | sql/dispatch/create_partition.sql | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/dispatch/create_partition.sql b/sql/dispatch/create_partition.sql index 48d8a012..771604e8 100644 --- a/sql/dispatch/create_partition.sql +++ b/sql/dispatch/create_partition.sql @@ -37,6 +37,7 @@ declare pos int4; fq_table text; fq_part text; + q_grantee text; g record; r record; sql text; @@ -112,8 +113,12 @@ begin where table_schema = parent_schema and table_name = parent_name loop - sql := 'grant ' || g.privilege_type || ' on ' || fq_part - || ' to ' || quote_ident(g.grantee); + if g.grantee = 'PUBLIC' then + q_grantee = 'public'; + else + q_grantee := quote_ident(g.grantee); + end if; + sql := 'grant ' || g.privilege_type || ' on ' || fq_part || ' to ' || q_grantee; if g.is_grantable = 'YES' then sql := sql || ' with grant option'; end if; |