Re: [HACKERS] Custom compression methods (mac+lz4.h) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Custom compression methods (mac+lz4.h)
Date
Msg-id CA+TgmoZhqwvoMQ-6_UcrBXOdvz=66X814VyBWK2jDSN0BPm8Xw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Custom compression methods (mac+lz4.h)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Custom compression methods (mac+lz4.h)
List pgsql-hackers
On Mon, Mar 22, 2021 at 11:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Anyway, this particular macro name was chosen, it seems, for symmetry
> > with VARDATA_4B_C, but if you want to change it to something else, I'm
> > OK with that, too.
>
> After looking at postgres.h for a bit, I'm thinking that what these
> should have been symmetric with is the considerably-less-terrible
> names used for the corresponding VARATT_EXTERNAL cases.  Thus,
> something like
>
> s/VARRAWSIZE_4B_C/VARDATA_COMPRESSED_GET_RAWSIZE/
> s/VARCOMPRESS_4B_C/VARDATA_COMPRESSED_GET_COMPRESSION/

Works for me.

> Possibly the former names should survive and the latter become
> wrappers around them, not sure.  But we shouldn't be using the "4B"
> terminology anyplace except this part of postgres.h.

I would argue that it shouldn't be used any place at all, and that we
ought to go the other direction and get rid of the existing macros -
e.g. change #define VARATT_IS_1B_E to #define VARATT_IS_EXTERNAL
instead of defining the latter as a no-value-added wrapper around the
former. Maybe at one time somebody thought that the test for
VARATT_IS_EXTERNAL might someday have more cases than just
VARATT_IS_1B_E, but that's not looking like a good bet in 2021.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Minimal logical decoding on standbys
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Custom compression methods (mac+lz4.h)