【问题标题】:Multiple Tables or Multiple Schema多个表或多个模式
【发布时间】:2010-03-26 02:55:57
【问题描述】:

Postgresql: is it better using multiple databases with 1 schema each, or 1 database with multiple schemas?

我是 PostgreSQL 架构概念的新手。

对于上述场景,我想知道

  1. 我们为什么不使用单个数据库(使用名为 public 的默认架构)
  2. 为什么我们没有一个表来存储多个用户行?
  3. 保存用户相关信息的其他表,外键指向用户表。

谁能给我一个真实的案例场景,哪个单库多模式会非常有用,是常规单库单模式解决不了的。

【问题讨论】:

    标签: database-design postgresql


    【解决方案1】:

    来自http://www.postgresql.org/docs/8.4/interactive/ddl-schemas.html

    人们可能想要使用模式有几个原因:

    *To allow many users to use one database without interfering with each other.
    *To organize database objects into logical groups to make them more manageable.
    *Third-party applications can be put into separate schemas so they do not collide with the names of other objects. 
    

    架构类似于操作系统级别的目录,但架构不能嵌套。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-28
      • 2013-03-10
      • 2013-08-26
      • 2018-04-12
      • 2018-04-30
      • 1970-01-01
      • 2020-02-06
      相关资源
      最近更新 更多