TIL: In pg_dump, beware the combo of "-Fd" and "-Z"

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Date: 2021-01-19 18:48:36
Message-ID: 1ad81a44-b39e-5854-ba82-0bd1b61bef25@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PostgreSQL 12.1-2.module+el8.1.1+4794+c82b6e09 from the RHEL 8.3
repository.  (Installing software outside of the RHEL is Against Policy.)

For a project using 9.6, I have this command backing up a database:
pg_dump -d ${DB} -j ${THREADS} -Fd -Z0 -v -f $DB 2> ${DB}_pgdump.log

So, for the 12 project, I copied it over, removing the "0", since I want
these backups compressed.
pg_dump -d ${DB} -j ${THREADS} -Fd -Z -v -f $DB 2> ${DB}_pgdump.log

Since the -Z default is "6", I assumed that would compress the backup.  It
didn't, acting instead like "-Z0".  Removing "-Z" made it compress.

This surprised me, and is very counter-intuitive.  A bug?

--
Angular momentum makes the world go 'round.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2021-01-19 19:55:34 Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Previous Message lazaro garcia 2021-01-19 15:55:15 Re: Table Partitioning