相关疑难解决方法(0)

你如何在 postgresql 9.4 上撤销用户的创建表?

我正在尝试创建一个 postgresql 用户,该用户可以选择但不能在数据库上创建或删除、插入等,但我终生无法弄清楚如何阻止用户创建自己的表。

到目前为止我所做的:

create database test;
create role readonly;
alter role readonly with login;
alter role readonly with encrypted password 'test';
revoke all on schema public from public;
revoke all on schema public from readonly;
revoke all on database test from public;
revoke all on database test from readonly;
grant connect on database test to readonly;
Run Code Online (Sandbox Code Playgroud)

然而,当我以只读身份登录到数据库时,我仍然可以不受惩罚地创建表。我错过了什么?

postgresql permissions postgresql-9.4

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

permissions ×1

postgresql ×1

postgresql-9.4 ×1