PostgreSQL运维—REASSIGN OWNED

网友投稿 894 2022-09-27

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

PostgreSQL运维—REASSIGN OWNED

postgres=# create user u1;CREATE ROLEpostgres=# create user u2;CREATE ROLEpostgres=# create table t1 (id int);CREATE TABLEpostgres=# \c - u1You are now connected to database "postgres" as user "u1".postgres=> select * from t1;ERROR: permission denied for table t1postgres=# \c - u2You are now connected to database "postgres" as user "u2".postgres=> select * from t1;ERROR: permission denied for table t1postgres=> \c - postgresYou are now connected to database "postgres" as user "postgres".postgres=# grant select on t1 to u1;GRANTpostgres=# \c - u1You are now connected to database "postgres" as user "u1".postgres=> select * from t1; id ----(0 rows)postgres=> \c - postgresYou are now connected to database "postgres" as user "postgres".postgres=# reassign owned by u1 to u2;REASSIGN OWNEDpostgres=# \c - u2You are now connected to database "postgres" as user "u2".postgres=> select * from t1; id ----(0 rows)postgres=>

上一篇:Nagios 安装及微信短信提醒(Nagios魔物喵)
下一篇:盘点 DevOps 世界的杰出女性(一)(盘点总结怎么写)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~