Re: remove bits* types

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: remove bits* types
Date: 2026-03-25 16:27:34
Message-ID: a3b5edc3-c0f5-42ae-b463-17018ee03dcb@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18.03.26 22:38, Nathan Bossart wrote:
> (new thread)
>
> On Wed, Mar 18, 2026 at 04:17:40PM -0500, Nathan Bossart wrote:
>> On Tue, Mar 17, 2026 at 05:09:49PM -0400, Andres Freund wrote:
>>> Personally I object to the existence of the bits* types, to me they're just
>>> noise over using the corresponding unsigned integer types. One more thing that
>>> one has to just know what it means without there being any actual improved
>>> type checking or such. It's not like using bits* would make it any easier to
>>> make the underlying type a struct or such (which is different to
>>> e.g. TransactionId, we could probably replace that with a struct without crazy
>>> amounts of trouble).
>>
>> Yeah, I don't see why you'd prefer bits32 over uint32. If anything, uint32
>> is probably less confusing because most hackers will have used it before.
>> AFAICT the bits* types are a relic of the 80s, and there used to be other
>> types like bool8 and word32, all of which were just uint* behind the
>> scenes. Those were removed in 2004 by commit ca7a1f0c86. I assume bits*
>> was left behind because it was still in use.
>>
>>> I think we should just rip the bits* types out and replace them with the
>>> underlying types.
>>
>> +1. If there seems to be consensus, I'm happy to write the patch.
>
> Well, in the process of seeing how bad the patch would look, I ended up
> writing it. I used sed for most of this, and I tried to make all necessary
> manual adjustments, but I may have missed a couple.

I'm mildly in favor of removing them. But it appears there is no consensus.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-03-25 16:33:03 Re: Add tab completion for SERVER and CONNECTION keywords in psql
Previous Message Cliff Clark 2026-03-25 16:24:13 Re: [PATCH] Auto vacuum should still run when clock is set back