pg_dump toc.dat缺少公共模式线

发布于 2025-01-31 15:51:13 字数 1056 浏览 4 评论 0原文

我正在尝试解析toc.dat文件,从不同的pg_dump版本转移相同的数据库时,我会看到不同的结果。在9.6上,我有schema public Postgres,但我没有11 pg_dump 。

有人知道为什么是吗?找不到有关该行为的任何释放说明:

postgres db ~ $ /usr/lib/postgresql/11/bin/pg_dump --format=custom -d db -p 5432 --schema-only -f /tmp/test-11-dump
postgres db ~ $ pg_restore -l -v /tmp/test-11-dump | grep "SCHEMA public" -A 1 -B 1
;   depends on: 205
22859; 0 0 ACL - SCHEMA public postgres
;   depends on: 74                           <--- no line with this id

postgres db ~ $ /usr/lib/postgresql/9.6/bin/pg_dump --format=custom -d db -p 5432 --schema-only -f /tmp/test-96-dump
postgres db ~ $ pg_restore -l -v /tmp/test-96-dump | grep "SCHEMA public" -A 1 -B 1
74; 2615 2200 SCHEMA - public postgres       <--- this line is missing from prev one
22832; 0 0 COMMENT - SCHEMA public postgres
;   depends on: 74
22833; 0 0 ACL - SCHEMA public postgres
;   depends on: 74

postgres db ~ $ pg_restore --version
pg_restore (PostgreSQL) 11.15 (Ubuntu 11.15-1.pgdg18.04+1)

I'm trying to parse the toc.dat file and I see different result when dumping same database from different pg_dump versions. On 9.6 I've got line with SCHEMA public postgres but I don't have this line from 11 pg_dump.

Anyone knows why's that? Can't find any release notes on that behaviour:

postgres db ~ $ /usr/lib/postgresql/11/bin/pg_dump --format=custom -d db -p 5432 --schema-only -f /tmp/test-11-dump
postgres db ~ $ pg_restore -l -v /tmp/test-11-dump | grep "SCHEMA public" -A 1 -B 1
;   depends on: 205
22859; 0 0 ACL - SCHEMA public postgres
;   depends on: 74                           <--- no line with this id

postgres db ~ $ /usr/lib/postgresql/9.6/bin/pg_dump --format=custom -d db -p 5432 --schema-only -f /tmp/test-96-dump
postgres db ~ $ pg_restore -l -v /tmp/test-96-dump | grep "SCHEMA public" -A 1 -B 1
74; 2615 2200 SCHEMA - public postgres       <--- this line is missing from prev one
22832; 0 0 COMMENT - SCHEMA public postgres
;   depends on: 74
22833; 0 0 ACL - SCHEMA public postgres
;   depends on: 74

postgres db ~ $ pg_restore --version
pg_restore (PostgreSQL) 11.15 (Ubuntu 11.15-1.pgdg18.04+1)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月光色 2025-02-07 15:51:13

请参阅此提交

这具有明显的效果,即根本不会在输出中提及公共架构,除了更新其ACL(如果它具有非默认ACL)。

See this commit pg_dump the relevant part being:

This has the visible effect that the public schema won't be mentioned in the output at all, except for updating its ACL if it has a non-default ACL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文