我需要给当前用户("userA")什么样的grant
选项/技巧,以允许他更改另一个用户("userC")所属对象的所有者?
更准确地说,contact表归userC所有,当我执行以下查询将所有者更改为userB时,与userA连接:
alter table contact owner to userB;
我得到了这个错误:
ERROR: must be owner of relation contact
但userA拥有正常情况下所需的所有权利(create on schema赠款选项应该足够):
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=>