码迷,mamicode.com
首页 > 其他好文 > 详细

pg用户赋予只读权限

时间:2020-06-21 17:42:25      阅读:78      评论:0      收藏:0      [点我收藏+]

标签:schema   role   load   active   postgres   sch   ble   tab   tran   

./createuser --interactive iomsx;
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n

./psql -p 15432
alter user iomsx with password ‘iomsx2_2022022‘;
alter user iomsx set default_transaction_read_only=on;
grant all on database skylarx2 to ioms;
\c skylarx2
grant select on all tables in schema public to ioms;
\quit

vi pg_hba.conf
peer 修改成md5
/etc/init.d/postgres/reload

./psql -p 15432 -U ioms -d skylarx2

pg用户赋予只读权限

标签:schema   role   load   active   postgres   sch   ble   tab   tran   

原文地址:https://www.cnblogs.com/vzhangxk/p/13173168.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!