pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Date: Tue, 19 Jan 2021 15:11:46 -0600
Message-ID: <267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com> (raw)
In-Reply-To: <CAKFQuwYcWQP=G45=oTHkXa5f2EN_emSJbAy1chOg+hTd_wrjmg@mail.gmail.com>
References: <1ad81a44-b39e-5854-ba82-0bd1b61bef25@gmail.com>
	<CAKFQuwYcWQP=G45=oTHkXa5f2EN_emSJbAy1chOg+hTd_wrjmg@mail.gmail.com>

On 1/19/21 1:55 PM, David G. Johnston wrote:
> On Tuesday, January 19, 2021, Ron <ronljohnsonjr@gmail.com 
> <mailto:ronljohnsonjr@gmail.com>> wrote:
>
>
>     For a project using 9.6, I have this command backing up a database:
>     So, for the 12 project, I copied it over, removing the "0", since I
>     want these backups compressed.
>
>
> The versions in use doesn’t seem pertinent to the observation - this 
> behavior hasn’t changed (at least in the docs).
>
>
>     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."

It doesn't say "6", but every other bit of software I've used defaults to 
level 6.

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

"For the custom archive format, this specifies compression of individual 
table-data segments, and the default is to compress at a moderate level."

Since -Fc and -Fd are so similar, I worked off the notion that -Z works 
similarly for both.

>
>      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?
>
>
> That we accept a -Z parameter without a number without complaint would be 
> a bug given the documentation doesn’t indicate the number as being 
> optional.  That “-Z” and “-Z 0” are equivalent makes sense if one allows “-Z”.

As mentioned above, -Z6 is the default on all the other software I use, so 
worked of the notion that Postgres uses that default, too.

-- 
Angular momentum makes the world go 'round.

view thread (8+ messages)  latest in thread

Message-ID: <267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com>
Permalink:  ../267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com/
Also on:    postgresql.org/message-id/267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
  In-Reply-To: <267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox