Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l26BS-0001kO-Fm for pgsql-admin@arkaria.postgresql.org; Wed, 20 Jan 2021 05:37:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l26BR-0005ig-2q for pgsql-admin@arkaria.postgresql.org; Wed, 20 Jan 2021 05:37:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l26BQ-0005iY-PB for pgsql-admin@lists.postgresql.org; Wed, 20 Jan 2021 05:37:32 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l26BO-0005fY-8d for pgsql-admin@lists.postgresql.org; Wed, 20 Jan 2021 05:37:32 +0000 Received: by mail-ot1-x333.google.com with SMTP id i30so9382190ota.6 for ; Tue, 19 Jan 2021 21:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=J1E96DhAbGYO7BPxWIVBcSq3gA185UxQdfPEDLeZOP4=; b=PeFm8A1Kwr3i6vRtEgEPc+Ua7STVRO6MvWRPKTh3PGVzwwcaXVaFwpIhDZ4ZEz0wau eod1FuMrFiHMxgjsMongm1RRmFM7KkY1KDbNqOvBifwPfQ2dKoDV2YO7e/ve7YOk3x9g fLwmy8Uh/fY2fuNc/yvKs2oAJAHvdzDmXsV31zLcwWUtxHm+l+dj9wJeEhegRtGO3wAm hm0+aq+DH/s2MAXVZ7/eX5MZdSDhXxXIethZiwu0ZLwhS/G9zF1Hg+VaPEMUHK8jkfiD XtYF4BMhjuMQbX/yvMlOHesV1SXFyPLg1SJcRii58/MVym8N3/DcasbNqi6761B5ximx D3Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=J1E96DhAbGYO7BPxWIVBcSq3gA185UxQdfPEDLeZOP4=; b=njZ1SOPV6sw9eCJDg1c6l3/hr1UmNeG26Kge5r+QxVcqe+ApP5OMFZ5gkX+6aVZXgb ReEI05C9LCGZghJW62VW81WNRVf7EEPHqmeHnTBtYPcd6xQRl6ktwneFaedq6friPzWu gHz6YM6zaPZ9S3meu/o/dyBaVE5aBDZWOI8VJKDWD1RCp++QKI7bMXp3GDndTz2zQAvF RDa+/w9s7IxSlWB2xkejO0tpmSSGoOFrA2HI1xGKW8/7QYHoPK8waUmtrLPRn/v1DDlC qJEjLo/jeG/jKsLTMW89B/QDlzUvHG1dk2z8ahGI2iJcM8BLOGvJVZdvL5eKcsMduh4F XUOA== X-Gm-Message-State: AOAM532jylvB50scQ7/YhYqyXamhExErcdeai3YAO/4UUQifzOcua5wi cBP323iaDIDYbIJ+TzI86Du2UfoI9fgfGw== X-Google-Smtp-Source: ABdhPJwAcIgjECVzJPxSnQ78Uv7off9NNOnaxEuekB/g4no9WkmdxDiXKgFXM0rkCiB/m/u7Rlugcw== X-Received: by 2002:a9d:3e42:: with SMTP id h2mr6087470otg.275.1611121048008; Tue, 19 Jan 2021 21:37:28 -0800 (PST) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id y24sm200102oos.44.2021.01.19.21.37.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jan 2021 21:37:27 -0800 (PST) Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z" To: pgsql-admin@lists.postgresql.org References: <1ad81a44-b39e-5854-ba82-0bd1b61bef25@gmail.com> <267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com> <249144ee-e91c-adfb-bcfa-dc1c5462e0c4@03s.net> From: Ron Message-ID: Date: Tue, 19 Jan 2021 23:37:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <249144ee-e91c-adfb-bcfa-dc1c5462e0c4@03s.net> Content-Type: multipart/alternative; boundary="------------387F4E56B6E7F45C4B4C24D0" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------387F4E56B6E7F45C4B4C24D0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 1/19/21 10:54 PM, Adrian Ho wrote: > On 20/1/21 5:11 am, Ron wrote: >> On 1/19/21 1:55 PM, David G. Johnston wrote: >>> On Tuesday, January 19, 2021, Ron >> > 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. > > A quick look at the `pg_dump` source code indicates that: > > * `-Z` requires an argument, and > > * the argument is converted to an integer with the `atoi()` C function > > This means that `-Z` actually took `-v` as its argument, which `atoi()` > converts to integer 0. That explains what you saw, and I'm also guessing > you did NOT get verbose output from your second command. > That's right. -- Angular momentum makes the world go 'round. --------------387F4E56B6E7F45C4B4C24D0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 1/19/21 10:54 PM, Adrian Ho wrote:
On 20/1/21 5:11 am, Ron wrote:
On 1/19/21 1:55 PM, David G. Johnston wrote:
On Tuesday, January 19, 2021, Ron <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.

A quick look at the `pg_dump` source code indicates that:

* `-Z` requires an argument, and

* the argument is converted to an integer with the `atoi()` C function

This means that `-Z` actually took `-v` as its argument, which `atoi()` converts to integer 0. That explains what you saw, and I'm also guessing you did NOT get verbose output from your second command.


That's right.

--
Angular momentum makes the world go 'round.
--------------387F4E56B6E7F45C4B4C24D0--