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 1rzfvm-005nwy-Li for pgsql-admin@arkaria.postgresql.org; Wed, 24 Apr 2024 16:57:14 +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 1rzfvk-00GJeg-BA for pgsql-admin@arkaria.postgresql.org; Wed, 24 Apr 2024 16:57:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzfvj-00GJeY-Vu for pgsql-admin@lists.postgresql.org; Wed, 24 Apr 2024 16:57:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzfvd-002jgp-BL for pgsql-admin@lists.postgresql.org; Wed, 24 Apr 2024 16:57:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 43OGv3A93722469; Wed, 24 Apr 2024 12:57:03 -0400 From: Tom Lane To: "Vitale, Anthony, Sony Music" cc: "pgsql-admin@lists.postgresql.org" Subject: Re: ERROR: index row size 2720 exceeds btree version 4 maximum 2704 for index in V14 but pg_column_size calculates 2701 In-reply-to: References: Comments: In-reply-to "Vitale, Anthony, Sony Music" message dated "Wed, 24 Apr 2024 16:40:56 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3722467.1713977823.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 24 Apr 2024 12:57:03 -0400 Message-ID: <3722468.1713977823@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Vitale, Anthony, Sony Music" writes: > I am trying to figure out how to calculate a column size in my UTF8 enco= ded Postgresql V14 instance in order to avoid the error exceeds btree vers= ion 4 maximum 2704 and I am obviously not doing it correctly using pg_col= umn_size as when I do I get 2701 which is lower than 2704. I think you're not accounting for overhead. The reported index row size would include the index tuple header (8 bytes) as well as alignment padding. regards, tom lane