From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
Date: Wed, 20 Jan 2021 15:27:18 -0500
Message-ID: <784982.1611174438@sss.pgh.pa.us> (raw)
In-Reply-To: <d68bd2ad-f9ba-21e0-6b32-da9e4476b008@gmail.com>
References: <1ad81a44-b39e-5854-ba82-0bd1b61bef25@gmail.com>
<CAKFQuwYcWQP=G45=oTHkXa5f2EN_emSJbAy1chOg+hTd_wrjmg@mail.gmail.com>
<267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com>
<249144ee-e91c-adfb-bcfa-dc1c5462e0c4@03s.net>
<d68bd2ad-f9ba-21e0-6b32-da9e4476b008@gmail.com>
Ron <ronljohnsonjr@gmail.com> writes:
> On 1/19/21 10:54 PM, Adrian Ho wrote:
>> 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.
Using atoi or siblings without any error checking is not unusual in our
programs (or lots of others, I imagine). I recall some past discussion
of tightening up parsing of integer arguments to complain if they
didn't look like integers. But evidently nobody's pushed that forward.
regards, tom lane
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: tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z"
In-Reply-To: <784982.1611174438@sss.pgh.pa.us>
* 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