
# 赋予用户schema的all权限后建表仍然报错ERROR: current user does not have privilege to role tom
#### 问题现象
有两个用户tom和jerry，jerry需要在tom的同名schema下创建表，于是tom把该schema的all权限赋予jerry，但是创建表时仍然报错：
```
dbtest=# GRANT all on schema tom to jerry;
GRANT
dbtest=# \c - jerry
Password for user jerry: 
Non-SSL connection (SSL connection is recommended when requiring high-security)
You are now connected to database "dbtest" as user "jerry".
dbtest=> 
dbtest=> CREATE TABLE tom.t(a int);
ERROR:  current user does not have privilege to role tom
```
#### 原因分析
根据报错内容，jerry需要角色tom的权限。
#### 处理方法
把角色tom的权限赋予jerry后，建表执行成功。
```
dbtest=# GRANT tom to jerry;
GRANT ROLE
dbtest=# \c - jerry
Password for user jerry: 
Non-SSL connection (SSL connection is recommended when requiring high-security)
You are now connected to database "dbtest" as user "jerry".
dbtest=> 
dbtest=> CREATE TABLE tom.t(a int);
NOTICE:  The 'DISTRIBUTE BY' clause is not specified. Using 'a' as the distribution column by default.
HINT:  Please use 'DISTRIBUTE BY' clause to specify suitable data distribution column.
CREATE TABLE
```
