pg用户赋予只读权限
Posted vzhangxk
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pg用户赋予只读权限相关的知识,希望对你有一定的参考价值。
./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用户赋予只读权限的主要内容,如果未能解决你的问题,请参考以下文章