pg_dump toc.dat 缺少 public 模式行
pg_dump toc.dat missing public schema line
我正在尝试解析 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)
查看此提交 pg_dump 相关部分是:
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.
我正在尝试解析 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)
查看此提交 pg_dump 相关部分是:
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.