From: Nathan Bossart <nathandbossart@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Andres Freund <andres@anarazel.de>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: remove bits* types
Date: Thu, 19 Mar 2026 09:47:26 -0500
Message-ID: <abwMfsZKFmf6ANXh@nathan> (raw)
In-Reply-To: <CA+TgmobL-dx2na5pV+5vb82txf-tQQLMkaEYyE50CgKymEUk6w@mail.gmail.com>
References: <202603182215.rvi6x75ekyba@alvherre.pgsql>
<1074366.1773873680@sss.pgh.pa.us>
<CA+TgmobL-dx2na5pV+5vb82txf-tQQLMkaEYyE50CgKymEUk6w@mail.gmail.com>
On Wed, Mar 18, 2026 at 07:15:29PM -0400, Robert Haas wrote:
> I'm definitely -1 on trying to use them more consistently. This is a
> 261 line patch. The reverse patch to use these types everywhere that
> we use integers as a collection of bits is probably 100 times that
> size. If you took that idea to its logical conclusion, every flags
> variable in the backend would end up getting converted.
This is definitely not accurate, but I counted around 400 such cases for
the reverse patch:
$ grep -E "int[0-9]* (flags|options)" src/* -rI | wc -l
409
> I'm not entirely sure that this is worth standardizing at all; if
> someone thinks that using bits8 or whatever makes the code more rather
> than less clear in a certain context, who am I to argue? If someone
> else prefers uint8 in another context, also fine.
>
> But if we are going to standardize, I think the only sensible choice
> is what Nathan's done here. The reverse would be an insane amount of
> code churn.
While nobody seems totally opposed to the idea, it does seem to be
generating some discussion. I'd rather not distract more important work
for v19, so I'm happy to put it on the shelf for now.
--
nathan
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: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, alvherre@kurilemu.de, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
Subject: Re: remove bits* types
In-Reply-To: <abwMfsZKFmf6ANXh@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox