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 1tWCVI-00EuwP-Vj for pgsql-general@arkaria.postgresql.org; Fri, 10 Jan 2025 10:44:37 +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 1tWCVH-00EsXW-K9 for pgsql-general@arkaria.postgresql.org; Fri, 10 Jan 2025 10:44: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 1tWCVH-00EsVE-6B for pgsql-general@lists.postgresql.org; Fri, 10 Jan 2025 10:44:34 +0000 Received: from mout.gmx.net ([212.227.17.21]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tWCVE-000ra2-0g for pgsql-general@lists.postgresql.org; Fri, 10 Jan 2025 10:44:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1736505870; x=1737110670; i=shammat@gmx.net; bh=5yaXsJ+dbwNmv0gik1IqR9T/9zyX4oyAyY9lW3dERI0=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=cbuCnmPkHSImvSLmx+6lHiCQEmzUajJmLFdH9wB25v8n20k2lnXkTK1a3k8FVkDk YElDgEviwwFvPOwp7CD0ASNaIX305ZtHMhxp2pAOwRvu0eLI+TUMtvkCWeAemK63r fO1/O37/ENbs4A2B8Ad2rdblMMtvQHldQcvMXn3u7LvD/nz8xH9NmExK7UPxVILsI vp/tifdFhTy6Vs3welzJ0xYVzvJ6I+8aoAB9ln1YyniVao6oNgKB0Io8BTEDlWRmc 0c5iu02R8xqcSjrAu8QT4MR6fExApc4Z5EGt2zVLGNwm94Jn6xlI3xV3+BWwxUJCY wHEcDzAe8YZbqc1utw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [10.8.0.17] ([185.40.248.10]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MhU9j-1t24YH2Xfn-00iu6x for ; Fri, 10 Jan 2025 11:44:30 +0100 Message-ID: Date: Fri, 10 Jan 2025 11:44:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Postgres do not support tinyint? To: pgsql-general@lists.postgresql.org References: <11AA76D0-CAFE-4A17-BCCF-50520CCDF47F@thebuild.com> <051EB6AC-2395-4EAD-B30C-069FBC01107F@thebuild.com> <59d067bdcf17bd5a624eb7c736779853@postgrespro.ru> Content-Language: de-DE, en-US From: shammat@gmx.net In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:494So3LKIJGaKuGNqcZ9JwhiNDQeJNFtLA7R/Xxm2Pb8Bq2iMnQ mUBo9EioYirWWQtO8AnjAjRSFv6FSMo3Sz5uMOshWBiVzz0JlOEnCwWCD5liR9i7xrG2wKh Cyqxr4Zd+B7rpWwJs+Wq2MaL0U/SU49wo3nsVNtlwbaQw1blpwKFHNETJK9bx1AdPFihBPz Btjmp+KqGKbt3b1SZ9DkA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:88prF07CEnY=;dcw9gn5ppSBCRaXOvUe9pTLIMON W2DxcH9TlLIDRYgRTsVlsHzrGIm/lxq54/k/BEvO0iqI3bIvxYavOq7gNkXb4JvSphAwyJzRo QYYsD5/c1UCpMMsefBCX5SMsmUY9gRAgvGjsOZLpXbcff26GLxSNbe5F5XhhfOTuyb+L05de1 jGVbFsQtAkvenpvg85Wom5bUD9YfAdxRYCUDOwfhmi+eCNBOK9LqBBXxo8phVKwTs0nOack1u xE9jdxWscWTzHO8eQ9oGXyHdu2XsJRovON/C36UfZAnVtqrfCA0dk+eqw64Mrz6ei/iLU42Q4 p7oZe39OsHYhh+FCjM/j96lHhpFtbe0aLWlmDMc7bgYbyIm2UIhT9Kd1M5elJKU0KSH8lWyeI wEhD3oexrqps4ipGnOiO29qMkUpyauHf2SVChI9sZBExvqxS2zkuNwca44Nb6b8xKhW4D546w s6Hij2vRHPLdejjc91KMX0Oepef9zMHnnChfA6zlv0/0rEsXc9L5QilhhsZnH0YR1DhTn6qD4 i5OxlmVu1zpmcBn70zO9fIpyx3kOyRuqWXK2qSFW6po6w/7NlZIZZt4w45joSETAM4Wbkzmnu x9YE5F4bjwPNBiKeplT+/Wo2n57lQqv62co4m6Z/FfvqbbkIywvxgdRWxMXkkgvrzk5myWotO BlMW9Dsx8/0w75zqcyxEbC2FvjZLlrOeA3fzuMaq5pqxa/MXmExdWWGS40hvxOf9sbP2UGP1L RSmzjCuZ6Y0VJHSAHSa8IYKW6epSNEGeJVjpFshMZiPpXqyPLdydF/JEFf94BmKnmIQtAcvqD lQzBK93L7eaSTmQ6r3QJ7MRm7RUT+l3gVRTkXG4FWo8Hgf5xn8aN03a8P1HhVOobdVB8yEReQ L9GF6QJuYu/g4L+uxH20RS5PgFpUQkfYnnKCVYNZ4eDYq7+o1ZInst4CNAKvj3++/7z+u6DJe OlwKvz6uCnFpI6NONVGehFLOKHyc36pq4GM4YlnCeax9gp9gHSca8dUBgSI63rY/PIXSIn+8D IILAae3B9dQO3ZVgsCWNWH3zFl3jgOGlkD8380BnlUUySSkKpsVjlTU8UUGfisdFgImXnuPMp kX8o23zY9lwsarpuW1HVuHS5g0JwHxrZHQekqhLLD3J7eQKNC7nZThwawM/nhbFn3midTf0+U = List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dominique Devienne schrieb am 10.01.2025 um 10:41: > On Fri, Jan 10, 2025 at 10:13=E2=80=AFAM Vladlen Popolitov > wrote: >> If you really need 1-byte integer, you can use "char" type. Cast it >> to/from int. See comment at the end of the page >> https://www.postgresql.org/docs/17/datatype-character.html > > Hi. What would be the best online doc to learn about the physical > storage / format for rows/pages/btree, etc... To understand alignment, > packing, varint or not, all those things. I'm quite familiar with the > [SQLite format][1], having read that doc dozens of times, and I'd like > a better low-level understanding for PostgreSQL as well. TIA, --DD The alignment requirement of each type is available in pg_type https://www.postgresql.org/docs/current/catalog-pg-type.html The physical layout on disk is described here: https://www.postgresql.org/docs/current/storage.html And the "Postgres intenrals" site might be helpful as well: https://www.interdb.jp/pg/pgsql01.html There are various (blog) posts on how to optimize space considering alignm= ent * https://stackoverflow.com/a/7431468 * https://www.enterprisedb.com/blog/rocks-and-sand The "postgres_dba" toolset has a little SQL script to evaluate the space s= avings: https://github.com/NikolayS/postgres_dba/blob/master/sql/p1_alignment_padd= ing.sql