Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z" - Mailing list pgsql-admin

From David G. Johnston
Subject Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Date
Msg-id CAKFQuwbA-iRQ5gTyLsJtAdG8CPZzwb_w1qoskSFqZc51=Q2n6Q@mail.gmail.com
Whole thread Raw
In response to Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-admin
On Tue, Jan 19, 2021 at 2:11 PM Ron <ronljohnsonjr@gmail.com> wrote:
Since the -Z default is "6"

It is?  Where do you see this?

https://www.postgresql.org/docs/12/app-pgdump.html

"-Z 0..9" 
"the default is to compress at a moderate level."

This sentence fragment does not exist in isolation, defaults are relative to the specific format and, apparently, only apply when this option is omitted.

What's also interesting is that this section doesn't mention what it does with directory format backups, though it does mention custom format.

Agreed, figured that directory is basically custom so they share the same default unless this parameter overrides it.
The whole thing reads:

"Specify the compression level to use. Zero means no compression. For the custom archive format, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip; but the default is not to compress. The tar archive format currently does not support compression at all."

Nowhere in that is an omitted value for -Z given a default value (nor is value omission noted as being allowed).

In short, the observed behavior seems fine and the documentation just needs to better match reality.

David J.

pgsql-admin by date:

Previous
From: Ron
Date:
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Next
From: Scott Ribe
Date:
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"