public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: PG 14 pg_basebackup accepts --compress=server-zst option
Date: Fri, 07 Jun 2024 11:33:08 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANzqJaAAJmAhgbYYx1T-+-A_myAEOLgDbzE3m5zfOQMwNzcCQQ@mail.gmail.com>
References: <CANzqJaB=-AUnoXh+V6ayLPbRut7yNt7utL-=0+OK4hdh35-cTQ@mail.gmail.com>
<CAAPsdhfQ0GvDuNeMZpe_sccHcM=7dHZq=C6wXbM8zFr_X2FD3g@mail.gmail.com>
<CAKFQuwYhAbOwvMfCSWg4VMAWDUX1kCZAdG1XQMKnWWFZYyOpTA@mail.gmail.com>
<CANzqJaAAJmAhgbYYx1T-+-A_myAEOLgDbzE3m5zfOQMwNzcCQQ@mail.gmail.com>
Ron Johnson <[email protected]> writes:
> On Fri, Jun 7, 2024 at 12:32 AM David G. Johnston <
> [email protected]> 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
view thread (5+ messages)
reply
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: PG 14 pg_basebackup accepts --compress=server-zst option
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox