【问题标题】:How to save PostgreSQL schema?如何保存 PostgreSQL 架构?
【发布时间】:2013-02-09 15:47:14
【问题描述】:

我需要将 PostgreSQL 数据库的架构发送给客户。
我该怎么做?
我在 db 目录中找不到它。

【问题讨论】:

    标签: postgresql schema


    【解决方案1】:

    最好使用pg_dump 实用程序来导出架构并重新加载到另一台机器上:

    pg_dump -U postgres --schema-only db_name > file.txt
    

    然后您可以使用 psql 实用程序将其加载回另一台机器/实例:

    psql -U postgres db_name < file.txt
    

    【讨论】:

      猜你喜欢
      • 2014-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多