postgresql - 为什么所有数据库在 PostgreSQL 中都有一个公共(public)模式?

标签 postgresql

我很好奇为什么 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/

相关文章:

hibernate - 在 hibernate/jpa 环境中实际删除实体?

mysql - 加入 3 个 sql 表并进行嵌套查询

postgresql - 为什么我的 PostgreSQL 随机数右填充零?

postgresql - 如何获取事务中的当前查询

sql - 在sql中显示另一个值中的值

java - Spring JPA :PropertyAccessException 1:. ..MethodInvocationException : .'driverClassName' . .. org/postgresql/Driver : Unsupported major. 次要版本 52.0

PostgreSQL,删除具有重新编号列值的行

sql - 获取表sql中每个字段的名称

sql - 使用Haskell的postgres-simple库执行多行插入时如何修复 "operator does not exist: text = uuid"?

java - docker-compose for jakartaee restful jpa Web应用程序无法正常工作