需要授予当前用户(“userA”)以允许他更改另一个用户(“userC”)所属的对象所有者的授权选项/技巧?
更准确地说,联系表由userC拥有,并且当我执行以下查询以将所有者更改为与用户A连接的用户B时:
alter table contact owner to userB;
我得到这个错误:
ERROR: must be owner of relation contact
但是userA具有正常的所有权限(“在架构上创建”授权选项应该是足够的):
grant select,insert,update,delete on all tables in schema public to userA; grant select,usage,update on all sequences in schema public to userA; grant execute on all functions in schema public to userA; grant references,trigger on all tables in schema public to userA; grant create on schema public to userA; grant usage on schema public to userA;
THKS
命令行输出:
root@server:~# psql -U userA myDatabase myDataBase=>\dt contact List of relations Schema | Name | Type | Owner -------+---------+----------+--------- public | contact | table | userC (1 row) myDataBase=> myDataBase=>alter table contact owner to userB; ERROR: must be owner of relation public.contact myDataBase=>