pg_dump toc.dat缺少公共模式线
我正在尝试解析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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此提交
See this commit pg_dump the relevant part being: