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 1l2K4f-0006AP-P2 for pgsql-admin@arkaria.postgresql.org; Wed, 20 Jan 2021 20:27:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2K4e-0000WT-Gb for pgsql-admin@arkaria.postgresql.org; Wed, 20 Jan 2021 20:27:28 +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 1l2K4e-0000WM-9I for pgsql-admin@lists.postgresql.org; Wed, 20 Jan 2021 20:27:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2K4X-0004hy-T2 for pgsql-admin@lists.postgresql.org; Wed, 20 Jan 2021 20:27:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10KKRIw0784983; Wed, 20 Jan 2021 15:27:18 -0500 From: Tom Lane To: Ron cc: pgsql-admin@lists.postgresql.org Subject: Re: TIL: In pg_dump, beware the combo of "-Fd" and "-Z" In-reply-to: References: <1ad81a44-b39e-5854-ba82-0bd1b61bef25@gmail.com> <267c0d6d-6a02-4c3a-b928-75472ce66de0@gmail.com> <249144ee-e91c-adfb-bcfa-dc1c5462e0c4@03s.net> Comments: In-reply-to Ron message dated "Tue, 19 Jan 2021 23:37:26 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <784981.1611174438.1@sss.pgh.pa.us> Date: Wed, 20 Jan 2021 15:27:18 -0500 Message-ID: <784982.1611174438@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ron 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