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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Date: 2021-01-19 21:25:38
Message-ID: CAKFQuwbA-iRQ5gTyLsJtAdG8CPZzwb_w1qoskSFqZc51=Q2n6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Jan 19, 2021 at 2:11 PM Ron <ronljohnsonjr(at)gmail(dot)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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2021-01-19 21:27:50 Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Previous Message Ron 2021-01-19 21:11:46 Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"