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

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Date: 2021-01-20 05:37:26
Message-ID: d68bd2ad-f9ba-21e0-6b32-da9e4476b008@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)gmail(dot)com
>>> <mailto:ronljohnsonjr(at)gmail(dot)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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message William Sescu (Suva) 2021-01-20 08:56:02 3 Parameters in pg_settings in CamelCase
Previous Message Anjul Tyagi 2021-01-20 04:58:11 Re: Table Partitioning