Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2ybJ-000mWE-0X for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 21:38:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2ybH-00ET2X-32 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 21:38:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2ybH-00ET2O-0M for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 21:38:47 +0000 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2ybB-00000000QjX-19GD for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 21:38:46 +0000 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-40438e0cba6so285338fac.1 for ; Wed, 18 Mar 2026 14:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773869922; x=1774474722; darn=lists.postgresql.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=mdCoRsSpJ8gMAztziyYeaZ/nAdD4K/Mh9wyfstdZSSA=; b=Lnaut5jIIy+0hWmshaT1Efm6TFAPWJX4+SzBXBTb4qQbFF2EAVGKvsWSHM30BeIpS2 9FJTCg4d3SD06BNGKtSnUuNX6xJDRehWKsr+LZIGUHK8MkmiTWAhZmVyAuCc+5KFEPWF CaKZe1JeF1fPNC0WNS03cwE2avq2jDM1uTQdAUASajTXPch15eZ5E6AWk5QKIM41SJCl EMSA3bgprsK4DwWLGNEO2hkDptXDq4LJKzTVThZyqUL9cOZNUP8Y0U1aP7pfT4hd7g3a m223N017z7sfTFNcgnXcvQYWZKh7kJcKYgeC+fFaiuCSEOhErj9+uFxX4U+2Tuu3r9gY 0erw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773869922; x=1774474722; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mdCoRsSpJ8gMAztziyYeaZ/nAdD4K/Mh9wyfstdZSSA=; b=kSn2AmnCrmE3AeENnZxwgk2hI2kmohSvYRw5bJ5JUGIVEk1s6cHFEJe9wQgxhjIJA9 AdODKuPexYShKteZ3zL3dtp8zUczMHHvuCoGKlK8oUCUL7xgFOb85EvZHYXQoXRDaa9K Xcxwc5XlNRVfd1Obl8e6lV8dTRUKuIxfOJL4X0dRGI1GvLorKMZgiNRNDUH0/OM4+Ya1 5ceTPacelE0IKgC82o3DzlcUyqaP1HODFjY1l3GSgHddokjOnOv43VmljnMicJPH3h1F IHjo0XTbTNxtc/Fk7bevC7WqY2Fe72PnYZPzDqh9MB/tktIejGi/HJcxVvp/lzkfdhYU Jt8A== X-Forwarded-Encrypted: i=1; AJvYcCU63dS8P7Ravs1St26KP8kx0khAwE/lKFRYd5Iu28GgmCsuMv2kaBas02BcswMRD9MF9Yv+4doZ3JCn9dnH@lists.postgresql.org X-Gm-Message-State: AOJu0YxnB3SxreZTn7acJ1VQm9B8Sdug2EGuBbs3vBYX+VxT0vFTlavz t2ijiEH2YOmnaIagw2K+aQnhEm6XfEzQYl09/8IgMt1B5AyaUw1n/W4e X-Gm-Gg: ATEYQzyJlBzeeuz/nPXM6il5HZZSpjVvea3Z4L/F9HURHXYfhrp6kBWpjY66X5+wtBa Dixz0x7deWluT42rVYRPGc9YRDVMaiEBLHwUaS9riNffm4nDN2tTPwsuGip/wbxSrioU+EWSeS0 JLhGsBOQjPSJSytyEPlTQ2mdSm1i3iEjpsaYEbXiCBq9gkpDFW6CzZa+m1hEU8u5zTQleFX1z1+ fqxKsQW+2mJ/B2AhKEvNqAWgqXvq08YkfvAPgarp4CcWiu+sHqR8+xhsH6fJL1/MlDDWTpXbImT iJ8LyyCw7m9VzQVPYmeF2hvA8zzmdi0XhXCoyTA7qzekICrr7vD53oUawxCJbdGz9tKfQxoO9pW Pb89csrQ+1JyRwev838UXAnz7+zIeEvcPw2OPM+9N7COIFOuXr8pNWytN6+6IwuMPGfxt/mn3X6 xsjH3554att66nb96EPCIelwvtYrFoyf9+x9DSaFnjOJ7WVN4raLKIUGTeMco23a7cWCJ5DlxaQ 4abfnykYSrSQOgpa2qJig== X-Received: by 2002:a05:6870:b012:b0:36e:8381:db00 with SMTP id 586e51a60fabf-41bd3b0d792mr3273877fac.9.1773869922024; Wed, 18 Mar 2026 14:38:42 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-41bd288c59esm3553406fac.5.2026.03.18.14.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 14:38:41 -0700 (PDT) Date: Wed, 18 Mar 2026 16:38:39 -0500 From: Nathan Bossart To: Andres Freund Cc: =?utf-8?Q?=C3=81lvaro?= Herrera , Pg Hackers Subject: remove bits* types Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="raj/7xW9mFi0VuDD" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --raj/7xW9mFi0VuDD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline (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. -- nathan --raj/7xW9mFi0VuDD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-remove-bits-types.patch