为什么 pg_dump 为公共模式添加额外的注释?

问题描述 投票:0回答:1

当我运行

pg_dump -d <database_name> --schema-only --no-privileges --no-owner --no-comment --file db/structure.sql
时,它将这些行添加到转储中:


--
-- Name: public; Type: SCHEMA; Schema: -; Owner: -
--

-- *not* creating schema, since initdb creates it

对于相同版本的不同机器(不使用 Homebrew)上的安装,这是不同的。那里没有添加这些行。

我通过 Homebrew 安装了 Postgres。

有办法配置吗?为什么要添加这些行?

尝试了不同版本的 postgres(15.5、16.2)。在另一台未使用 Homebrew 安装的机器上进行了尝试。

我在 pg_dump 的文档中找不到任何内容:https://www.postgresql.org/docs/15/app-pgdump.html 我在服务器设置中也找不到任何内容:https://www.postgresql.org/docs/15/runtime-config.html

如果设置相同,我希望不同机器上的相同版本能够提供相同的输出。

postgresql homebrew pg-dump
1个回答
0
投票

当我删除整个数据目录并通过重新安装重新创建它时,我没有收到额外的注释。旧数据目录是 Postgres 14 数据目录的升级。我仍然不清楚为什么这会导致额外的评论。

© www.soinside.com 2019 - 2024. All rights reserved.