Re: Simplifications for error messages related to compression - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Simplifications for error messages related to compression
Date
Msg-id 20221221051222.GL1153@telsasoft.com
Whole thread Raw
In response to Re: Simplifications for error messages related to compression  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Simplifications for error messages related to compression  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Dec 21, 2022 at 01:52:21PM +0900, Michael Paquier wrote:
> On Tue, Dec 20, 2022 at 08:29:32PM -0600, Justin Pryzby wrote:
> > -                       pg_fatal("not built with zlib support");
> > +                       pg_fatal("this build does not support compression with %s", "gzip");
> > 
> > I tried to say in the other thread that gzip != zlib.
> >
> > This message may be better for translation, but (for WriteDataToArchive
> > et al) the message is now less accurate, and I suspect will cause some
> > confusion.
> 
> Compression specifications use this term, so, like bbstreamer_gzip.c,

Yes, and its current users (basebackup) output a gzip file, right ?

pg_dump -Fc doesn't output a gzip file, but now it's using user-facing
compression specifications referring to it as "gzip".

> that does not sound like a big difference to me as everything depends
> on HAVE_LIBZ, still we use gzip for all the user-facing terms.

postgres is using -lz to write both gzip files and non-gzip libz files;
its associated compiletime constant has nothing to do with which header
format is being output.

    * This file includes two APIs for dealing with compressed data. The first
    * provides more flexibility, using callbacks to read/write data from the
    * underlying stream. The second API is a wrapper around fopen/gzopen and
    * friends, providing an interface similar to those, but abstracts away
    * the possible compression. Both APIs use libz for the compression, but
    * the second API uses gzip headers, so the resulting files can be easily
    * manipulated with the gzip utility.

> > 5e73a6048 introduced a similar user-facing issue: pg_dump -Fc -Z gzip
> > does not output a gzip.
> 
> We've never mentioned any compression method in the past docs, just
> that things can be compressed.

What do you mean ?

The commit added:
+        The compression method can be set to <literal>gzip</literal> or ...

And the docs still say:

-        For plain text output, setting a nonzero compression level causes
-        the entire output file to be compressed, as though it had been
-        fed through <application>gzip</application>; but the default is not to compress.

If you tell someone they can write -Z gzip, they'll be justified in
expecting to see "gzip" as output.

-- 
Justin



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: assertion failures on BuildFarm that happened in slab.c
Next
From: Peter Geoghegan
Date:
Subject: Re: New strategies for freezing, advancing relfrozenxid early