查询某些表报错:
1 permission denied for schema XXX
2 permission denied for relation XXX
第一个报错:
表或者视图所在的schema可能是其他用户创建(查询pg_class的relnamespace)
第二报错:
表或者视图直接用其他用户创建,比如A用户下的表(假设schema为shm),创建时用gpadmin创建:
spdb=# \dn
List of schemas
Name | Owner
------------+---------
gp_toolkit | gpadmin
public | gpadmin
shm1 | gpadmin
shm2 | dbuser
spdb=# create table shm2.t2(id int);
CREATE TABLE
spdb=# \c - dbuser;
You are now connected to database "spdb" as user "dbuser".
spdb=> select * from t2;
ERROR: permission denied for relation t2
(查询pg_class的relowner)