Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFbaf-003t0j-RI for pgsql-general@arkaria.postgresql.org; Fri, 07 Jun 2024 15:33:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sFbae-00Cup1-Cf for pgsql-general@arkaria.postgresql.org; Fri, 07 Jun 2024 15:33:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFbae-00Cuop-1o for pgsql-general@lists.postgresql.org; Fri, 07 Jun 2024 15:33:16 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFbaY-000TsX-7L for pgsql-general@postgresql.org; Fri, 07 Jun 2024 15:33:16 +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 457FX8cl1251343; Fri, 7 Jun 2024 11:33:08 -0400 From: Tom Lane To: Ron Johnson cc: pgsql-general Subject: Re: PG 14 pg_basebackup accepts --compress=server-zst option In-reply-to: References: Comments: In-reply-to Ron Johnson message dated "Fri, 07 Jun 2024 08:04:33 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1251341.1717774388.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 07 Jun 2024 11:33:08 -0400 Message-ID: <1251342.1717774388@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron Johnson writes: > On Fri, Jun 7, 2024 at 12:32 AM David G. Johnston < > david.g.johnston@gmail.com> wrote: >> I don’t see us adding an error message at this point. > Me neither. It just seemed odd. v14 thinks the argument of --compress must be an integer, and doesn't really bother with any syntax error checks: case 'Z': compresslevel = atoi(optarg); if (compresslevel < 0 || compresslevel > 9) { pg_log_error("invalid compression level \"%s\"", optarg); exit(1); } break; In your example, atoi() will return zero and it will sail along with no compression. Releases 15 and up have more complex ideas of what --compress can specify, and seem to syntax-check it much more thoroughly. This is a pretty common coding pattern, so I can't get excited about changing it, especially not in long-stable branches. regards, tom lane