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 1p5sxa-0005bh-Li for pgsql-general@arkaria.postgresql.org; Thu, 15 Dec 2022 18:27:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5sxZ-0004e3-HD for pgsql-general@arkaria.postgresql.org; Thu, 15 Dec 2022 18:27:57 +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 1p5sxZ-0004d7-6u for pgsql-general@lists.postgresql.org; Thu, 15 Dec 2022 18:27:57 +0000 Received: from smtp76.iad3b.emailsrvr.com ([146.20.161.76]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5sxX-0003NA-5b for pgsql-general@lists.postgresql.org; Thu, 15 Dec 2022 18:27:56 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp2.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 10DCD20163 for ; Thu, 15 Dec 2022 13:27:53 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Get size of variable-length attribute as stored on disk From: Christophe Pettus In-Reply-To: <33B2BCC6-0CB2-4D0E-AFA0-2C6F1D69B8A2@thebuild.com> Date: Thu, 15 Dec 2022 10:26:53 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <0803897E-EFBC-4AFC-90E2-98AE974B2FE1@thebuild.com> References: <33B2BCC6-0CB2-4D0E-AFA0-2C6F1D69B8A2@thebuild.com> To: pgsql-general X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Classification-ID: b532f04b-6653-48ea-b44a-60263a466d85-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 15, 2022, at 10:23, Christophe Pettus wrote: > Is there a way from SQL to get the size of a particular attribute = (field in a row) with a variable-length typed as stored on disk = (including compression)? The use case is to determine the size = distribution for setting TOAST_TUPLE_TARGET and making other decisions = about what to store in that field. Like, for instance, pg_column_size. :-) Never mind!=