postgresql 用户权限问题

lyqf365 2012-08-16 01:48:55
数据库一个[testdb]
用户三个
testdb_admin 可以创建、修改和删除testdb里的表
testdb_writer 可以对testdb里的每个表执行查询、插入、删除、更新操作,但不能创建和删除表
testdb_reader 可以对testdb里的表进行查询,但不能修改表里的行

这个应该怎么做?
...全文
158 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Rotel-刘志东 2012-08-20
  • 打赏
  • 举报
回复
1、grant create,update,delete on testdb.*to testdb_admin@'%'identity by 'newpassword';
2、grant select,insert,update,delete on testdb.* to testdb_wirte@'%' identity by 'newpassword';
3、grant testdb.*to testdb_writer@'%;' identity by 'newpassword';
rucypli 2012-08-16
  • 打赏
  • 举报
回复
如果是mysql

1
grant create,update,delete on testdb.* to testdb_admin@'%' identified by 'yourpassword';
2
grant select,insert,update,delete on testdb.* to testdb_writer@'%' identified by 'yourpassword';
3
grant select testdb.* to testdb_writer@'%' identified by 'yourpassword';

954

社区成员

发帖
与我相关
我的任务
社区描述
PostgreSQL相关内容讨论
sql数据库数据库架构 技术论坛(原bbs)
社区管理员
  • PostgreSQL社区
  • yang_z_1
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧