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 1tVOYV-007wwe-Rz for pgsql-general@arkaria.postgresql.org; Wed, 08 Jan 2025 05:24:36 +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 1tVOYV-00CvHD-CN for pgsql-general@arkaria.postgresql.org; Wed, 08 Jan 2025 05:24:35 +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 1tVOYV-00CvH4-0T for pgsql-general@lists.postgresql.org; Wed, 08 Jan 2025 05:24:34 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tVOYS-000SGt-1k for pgsql-general@lists.postgresql.org; Wed, 08 Jan 2025 05:24:33 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-71e173ed85bso7532371a34.3 for ; Tue, 07 Jan 2025 21:24:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736313872; x=1736918672; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ANMCYfDRE0f9qChlzOEiirSmyzqukYEJd5AurQIjw3k=; b=cBnjwebEEzJ37mZs8r991eI4t84IGUPxe464E0FBz/wSXrmIkSMVG0rxJfkI0f4nw1 VlA1IKz/ITL1SKR4BAyLn5TrxyhiGWqDD3NKQrZ6EV/1d1tTGsJ1yDAi0R9gWhAUgDcG q+64/TsXl5/ariuXconfUGCGF0cHTlIveckSkoquXFkDFSVJhmasWYf2KnHCNSUvn1cn Y6b8dnu7pE8qkkg8iWN175ZhewKSnFC8lY/URQjTe57EykDTEPcwlF2KE5O9uO6TYcxH 4nIkyhi9hDO3BqYb3lpdzde2aXGIjIZn3wr53TD9Jf2GjRu/W4dkXHMb42hv5wqWH+x1 7+Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736313872; x=1736918672; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ANMCYfDRE0f9qChlzOEiirSmyzqukYEJd5AurQIjw3k=; b=El/N3h5EXQ5YCVTYWl3MzzIS/LR0X+OsXrt5/SCrvftTc2fw3Vau/s+vqqgw9O6PUk skFnP7dRbc0FkTMihAJTMU6qKhR7/KQ8vjlDmcsV5+tTd4F+jnPMqDexuMWu9nC6VzLc Z99lKwSvrdJNayNofGnSbE1iqekXkSBjEtax32Pju08wqL/VPvQmdb7Oz5Re5jQXRnsd r6sG4g3oE6bmk5NzLIl9lxf06ZYl+Hv90RnsOOyg38BYvqA4qF/AUXe75v6pxcgXyx7U qAvS5vuZzgEICB5GD5HN9t03SBZvgc12+xzaErpGBcsMDys8YCSPg0rEKlVtWVO6qoaH c4Ew== X-Gm-Message-State: AOJu0YzrZBthrcPx78e+D8qmAuxbCmfKOIem2SsYaMxwj3CcJY+iMd1k 5N6Vr8ywA+tNTGKTeXNECbP0KnClZ73nf5KJ2xKFMPhp604Mydl2Ryu5EHXuih+lZXeNw/f5gko 0v/b3XTyatmYutT7rFAAjEeKX6ovGTg== X-Gm-Gg: ASbGncv+jHNvmcUeFK7LK8KRNIP/H5ncLEjtgs3/qgUSwhxHUkZc5ojx9BvYU8Glvn4 WFtkidHwHCCIXPCUj79qnWOGKL+rpHFjPIjqJun+PjwrO5WtmrXv7NTKE0kRhtF2LaQ7Q/KNy X-Google-Smtp-Source: AGHT+IE7XVZtsXkVjm79BcKG8B9H0uYAjwaeD4ieZkR1435Fr8s7CnOMf7VUUnZ4QF1WIcTBo8NXkzumQju3u6o4GTM= X-Received: by 2002:a05:6870:de10:b0:29e:3921:b1ea with SMTP id 586e51a60fabf-2aa0690f141mr907916fac.30.1736313872006; Tue, 07 Jan 2025 21:24:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Wed, 8 Jan 2025 00:24:21 -0500 X-Gm-Features: AbW1kvYMXWtrgq5GQusN_v6Nu1VyY3KJiy-I0V0XwWoWrMg48knR1Jy30stvLt0 Message-ID: Subject: Re: Postgres do not support tinyint? To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000008f4719062b2b137d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008f4719062b2b137d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 8, 2025 at 12:06=E2=80=AFAM Igor Korot wro= te: > Hi, ALL, > According to https://www.postgresql.org/docs/9.1/datatype-numeric.html, > the > smallest numeric type supports numbers from -32768 to 32767/ > > My data will be in a range of [0..4], and so I guess my DB table will was= te > space, right? > 1. It's not 1994 anymore, when 8M rows was enormous. 2. Record structures are padded by word size, so tinyint wouldn't matter unless you specifically ordered the fixed width columns from largest to smallest size when creating the table. 3. The "bit" type might serve your needs. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000008f4719062b2b137d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jan 8, 2025 at 12:06=E2=80=AFAM I= gor Korot <ikorot01@gmail.com&= gt; wrote:
Hi, ALL,
According to https://www.postgresql.org/doc= s/9.1/datatype-numeric.html, the
smallest numeric type supports numbers from -32768 to 32767/

My data will be in a range of [0..4], and so I guess my DB table will waste=
space, right?
=C2=A0
1. It's not 1= 994 anymore, when 8M rows was enormous.
2. Record structures are = padded by word size, so tinyint wouldn't matter unless you specifically= ordered the fixed width columns from largest to smallest size when creatin= g the table.
3. The "bit" type might serve your needs.<= /div>

--
Death to <Reda= cted>, and butter sauce.
Don't boil me, I'm still alive.
=
<Redacted> lobster!
--0000000000008f4719062b2b137d--