且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止用户能够查看其他数据库和其他数据库中的表?

更新时间:2023-01-18 16:59:05

每个用户都可以看到列出的其他数据库和角色,但永远不能看到其他数据库中的表。

Each user can see other databases and roles listed, but should not be able to see tables in other databases, ever.

如果撤消除分配的数据库外的所有数据库的CONNECT特权,用户将无法访问其他数据库的内容。

If you revoke CONNECT privilege on all databases except the allotted one, the user will not be able to access the contents of other databases.

角色和数据库名称是全局的,并不容易可***的。您可以尝试在系统表上进行选择性吊销的Frank Heikens建议,但您要冒险这样做。 Usenet邮件列表上的PostgreSQL开发人员不鼓励篡改对系统目录的访问。

Roles and database names are global, and not readily blockable. You can try Frank Heikens suggestion of selective revocations on the system tables, but you take risks to do that. PostgreSQL developers on the usenet mailing lists have discouraged tampering with access to the system catalogs.

Psql以及其他工具都假定它们将可用,并且如果没有它们,其功能将很差。

Psql, among other tools, assumes they will be available and functions poorly without them.

为什么知道其他数据库的名称和角色如此糟糕?

Why is knowing the names of other databases and roles so bad?