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.94.2) (envelope-from ) id 1tVbpK-009y8G-Pc for pgsql-general@arkaria.postgresql.org; Wed, 08 Jan 2025 19:34:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tVbpK-005LKa-8F for pgsql-general@arkaria.postgresql.org; Wed, 08 Jan 2025 19:34:49 +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.94.2) (envelope-from ) id 1tVbpJ-005LKO-TF for pgsql-general@lists.postgresql.org; Wed, 08 Jan 2025 19:34:49 +0000 Received: from smtp99.ord1d.emailsrvr.com ([184.106.54.99]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVbpH-000ZV5-1q for pgsql-general@lists.postgresql.org; Wed, 08 Jan 2025 19:34:48 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp5.relay.ord1d.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 4E884A0261; Wed, 8 Jan 2025 14:34:46 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: Postgres do not support tinyint? From: Christophe Pettus In-Reply-To: Date: Wed, 8 Jan 2025 11:34:15 -0800 Cc: "David G. Johnston" , Ron Johnson , "pgsql-generallists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <051EB6AC-2395-4EAD-B30C-069FBC01107F@thebuild.com> References: <11AA76D0-CAFE-4A17-BCCF-50520CCDF47F@thebuild.com> To: Igor Korot X-Mailer: Apple Mail (2.3776.700.51) X-Classification-ID: bf83061f-3956-42ad-87d9-14dbd8822384-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jan 8, 2025, at 11:30, Igor Korot wrote: > There is no boolean - it is 0-4 inclusive. Unless you have somehow gotten PostgreSQL running on an IBM 7070, the = range 0-4 can be represented by three binary digits, aka booleans. :-) To be serious, though, the situation is: 1. If there are just one or two tinyints, having a tinyint type wouldn't = save any space in the row. 2. If there are a lot of them, it's worth encoding them into a = bitstring.=