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 1uwjZS-006mMl-St for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Sep 2025 15:50:50 +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 1uwjYT-008fZW-01 for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Sep 2025 15:49:49 +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 1uwjYS-008fZN-Ne for pgsql-bugs@lists.postgresql.org; Thu, 11 Sep 2025 15:49:49 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uwjYR-001rri-1d for pgsql-bugs@lists.postgresql.org; Thu, 11 Sep 2025 15:49:48 +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 58BFnjnp1788651; Thu, 11 Sep 2025 11:49:45 -0400 From: Tom Lane To: natalya@timescale.com cc: pgsql-bugs@lists.postgresql.org, Peter Geoghegan Subject: Re: BUG #19049: Assert failure when using skip arrays on an index key with DESC order In-reply-to: <19049-b7df801e71de41b2@postgresql.org> References: <19049-b7df801e71de41b2@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 11 Sep 2025 12:38:11 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1788649.1757605784.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 11 Sep 2025 11:49:45 -0400 Message-ID: <1788650.1757605785@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > -- This query crashes with an Assert > select distinct on(s0, s1) * from mv where t2 >=3D -1 and t1 < 10 order= by > s0, s1, t1 desc, t2 desc; > Assert is: > if (ScanDirectionIsForward(dir) && array->low_compare) > Assert(DatumGetBool(FunctionCall2Coll(&array->low_compare->sk_func, > array->low_compare->sk_collation, tupdatum, array->low_compare->sk_argum= ent))); Indeed. "git bisect" says this started at b3f1a13f22f9e28842ee5fbd08b7ec805e27aaac is the first bad commit commit b3f1a13f22f9e28842ee5fbd08b7ec805e27aaac Author: Peter Geoghegan Date: Fri Apr 4 14:14:08 2025 -0400 Avoid extra index searches through preprocessing. Peter, you want to take a look? regards, tom lane