Home > OS >  pg_dump toc.dat missing public schema line
pg_dump toc.dat missing public schema line

Time:05-24

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)

CodePudding user response:

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.

  • Related