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 1t9ENv-008Yep-3K for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Nov 2024 02:06:02 +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 1t9ENq-004qRO-GH for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Nov 2024 02:05:59 +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 1t9ENq-004qRE-7P for pgsql-bugs@lists.postgresql.org; Fri, 08 Nov 2024 02:05:58 +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 1t9ENm-000lpf-MQ for pgsql-bugs@lists.postgresql.org; Fri, 08 Nov 2024 02:05:58 +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 4A825mD33534899; Thu, 7 Nov 2024 21:05:48 -0500 From: Tom Lane To: Alexander Korotkov cc: Tender Wang , nicolas.maus@bertelsmann.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18692: Segmentation fault when extending a varchar column with a gist index with custom signal length In-reply-to: References: <18692-72ea398df3ec6712@postgresql.org> <3261639.1730912933@sss.pgh.pa.us> Comments: In-reply-to Alexander Korotkov message dated "Fri, 08 Nov 2024 01:28:06 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3534897.1731031548.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Nov 2024 21:05:48 -0500 Message-ID: <3534898.1731031548@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Korotkov writes: > On Thu, Nov 7, 2024 at 8:47=E2=80=AFAM Tender Wang = wrote: >> Based on Tom's analysis, I provide a POC patch. I'm not sure if it is = right >> to use DEFAULT_COLLATION_OID in the patch. > Thank you. But I'm not sure about DEFAULT_COLLATION_OID. I don't quite trust that either. But since we only care about equality, wouldn't it be OK to use C_COLLATION_OID? > Therefore, we can compare two text[] just with datumIsEqual(). > Attached patch implements this. I think this is nonsense. What about toasted datums, or even just short-header ones? The one coming from an on-disk tuple is pretty likely to be short-header for plausible sizes of the options, but the one we just constructed in memory will not be. regards, tom lane