Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

pg_dump toc.dat missing public schema line

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)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading