我很好奇为什么 PostgreSQL 中的所有数据库都有一个所有用户都可以访问的 public
模式。我知道我可以撤销权限并将其授予一个用户,但为什么这不是默认设置?
最佳答案
没有给出太多理由,但请参阅 [5.7.6][1] 部分在手册中,但我认为以下内容可以回答您的问题:
If you do not create any schemas then all users access the public schema implicitly. This simulates the situation where schemas are not available at all. This setup is mainly recommended when there is only a single user or a few cooperating users in a database. This setup also allows smooth transition from the non-schema-aware world.
关于postgresql - 为什么所有数据库在 PostgreSQL 中都有一个公共(public)模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2134574/