Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKjxT-000701-IF for pgsql-docs@arkaria.postgresql.org; Mon, 30 Aug 2021 16:16:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mKjxS-0000c5-H5 for pgsql-docs@arkaria.postgresql.org; Mon, 30 Aug 2021 16:16:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKjxS-0000bu-B3 for pgsql-docs@lists.postgresql.org; Mon, 30 Aug 2021 16:16:26 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKjxN-0001Ah-KY for pgsql-docs@lists.postgresql.org; Mon, 30 Aug 2021 16:16:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TQ5q9aD6gork/rkmNQ4G1Bls79789xzLFW1H/lcXxXM=; b=2LQjNBBZ9q7RjtKuNlab90NyYY l9r6xIR8PERl9RJCcSSGzXiUb6PWDrYbazmXxPdm8w7qNCv4k8rgzxSZxSkk1ZDH+cin0tyF1ohhz pWaEfHoJvKC5W1OtlfO7f2g4xCH8YYCmiaIhrTq32sHALU/NWEND8uGcQVPgUsS5ZVcyQZeZrb7z6 yVX3WQRq3L7nPhvVtwUWNp7jv3o9aMm5uxw2Uf4J4OIWIS3MqPdTcXwbgoC8X3gFTqXDEozaRUL3h hO2Dm9XUX17nF9zAQdkJUPiyWxzgrW1pGbtVA1Cu6xA/jKlOG5+4v3UJKx1mNII9J+r/ImjIWGnu+ q0o1Byyw==; Received: from [52.119.84.106] (helo=Ph33rHippo.local) by meldrar.postgresql.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mKjxI-0007yM-3n; Mon, 30 Aug 2021 16:16:20 +0000 Subject: Re: I came here to determine how much storage a boolean variable uses To: "David G. Johnston" , troy@frericks.us, Pg Docs References: <163028282061.699.18102158472748913223@wrigleys.postgresql.org> From: "Jonathan S. Katz" Message-ID: Date: Mon, 30 Aug 2021 12:16:13 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6xtO8bWsAgiLMLQcGyWAVJl9gJIFIEhbx" X-Host-Lookup-Failed: Reverse DNS lookup failed for 52.119.84.106 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6xtO8bWsAgiLMLQcGyWAVJl9gJIFIEhbx Content-Type: multipart/mixed; boundary="gCMblJorlTEqOUKHIMscrRvnMw6DqFCFZ"; protected-headers="v1" From: "Jonathan S. Katz" To: "David G. Johnston" , troy@frericks.us, Pg Docs Message-ID: Subject: Re: I came here to determine how much storage a boolean variable uses References: <163028282061.699.18102158472748913223@wrigleys.postgresql.org> In-Reply-To: --gCMblJorlTEqOUKHIMscrRvnMw6DqFCFZ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/30/21 11:31 AM, David G. Johnston wrote: > On Sun, Aug 29, 2021 at 11:59 PM PG Doc comments form > > wrote: >=20 > The following documentation comment has been logged on the website:= >=20 > Page: https://www.postgresql.org/docs/13/datatype.html > > Description: >=20 > I'd like to see a fourth column added to Table 8-1 that contains th= e > size or > size range of the data type.=20 >=20 >=20 > I would argue this is sufficiently provided by the pg_attribute > catalog's attlen and attalign fields, as pointed to on the same page > linked below. >=20 > Maybe a note about the amount of space in the > row that a NULL column uses vs a NOT NULL. >=20 >=20 > Implementation detail that is covered in the internals section: >=20 > https://www.postgresql.org/docs/current/storage-page-layout.html#STORAG= E-TUPLE-LAYOUT > Well, it is provided one level deeper in the data type docs, e.g.: https://www.postgresql.org/docs/13/datatype-boolean.html I think it's a reasonable request to consider. It potentially duplicates the info in the data types section (i.e. one more thing to maintain), but it does provide some convenience for scanning it across the consolidated table. Jonathan --gCMblJorlTEqOUKHIMscrRvnMw6DqFCFZ-- --6xtO8bWsAgiLMLQcGyWAVJl9gJIFIEhbx Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEE+oS2la8r95ogZD/x8QSccp8cZScFAmEtBE0FAwAAAAAACgkQ8QSccp8cZSch 3xAAgL0zMKAl7+6J6LswHSeQL5YYE8+rfY6iypPbGlXR62AxpokaVjbOw+iN5cncVUw1EkNHS42B eDI7v4Z9arPFFyet15fK+Ck8lHXK9PakhmdVQ5HGQg+4hEiyJT4iKYNyQd1rE9gRDDvkoT7boiow 4UcDilvNP2FwEPEtU1KEiERcNs2hlt66btbxcdZuW+ihNR4asE7pql0ddf+G6xRaZp7kS4ffCLbu OtihgCCOw8MjuPMERJnKWuzTTC5gGasMJihKF4XhwZ+2sQxJydxjP0UgN/sjN9ggnW4Q6qHrc61e 6iZKQDxmnf/fbJ20le+sDtI+qJDOFNQlZWoFzvtKds5FZ1QIwXngLFqKSgsNiju7tFYRxzfnv26S YKISUrrNCDsSwcDHeAEl80782rM9zUAJWeQedvG+e913Bggq7A29FAnrHG0tekC4HUCT6kxP23lc kZzeZJkOyQVZwvveoivOap8XNwYwbbS8mnNNIHG9DCuraQSYzpmPAzppYL4xmxfdx9MCIKQvMPf0 so+SHHxlxNdeNcJOn8LRYFzxPAinrOZaBwg/zYFH2cLInoBEhd12kfK/5CT9Zojrqv2ZOrIhlgje FzFsdi50w2B5Fxa5KKmc3FApSGIh3hjTPkTE34qPTE+FCVk7REq2hijo3dXuJCBJbZmi+lsbfgGH qZI= =57Uf -----END PGP SIGNATURE----- --6xtO8bWsAgiLMLQcGyWAVJl9gJIFIEhbx--