From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Cc: | natalya(at)timescale(dot)com |
Subject: | BUG #19049: Assert failure when using skip arrays on an index key with DESC order |
Date: | 2025-09-11 12:38:11 |
Message-ID: | 19049-b7df801e71de41b2@postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 19049
Logged by: Natalya Aksman
Email address: natalya(at)timescale(dot)com
PostgreSQL version: 18rc1
Operating system: Ubuntu 24.04
Description:
Reproducer:
-- Set up a table with >=2 DESC index keys
create table mv (t1 int, t2 int, s0 int, s1 int);
create index on mv(s0, s1, t1 desc, t2 desc);
insert into mv select f.t, f.t, 1 s0, 1 s1 from generate_series(1, 2 *
pow(10, 4)::int) f(t);
analyze mv;
-- Make sure index is used
set enable_seqscan=0;
explain (costs off) select distinct on(s0, s1) * from mv where t2 >= -1 and
t1 < 10 order by s0, s1, t1 desc, t2 desc;
QUERY PLAN
-----------------------------------------------------------
Unique
-> Index Only Scan using mv_s0_s1_t1_t2_idx on mv
Index Cond: ((t1 < 10) AND (t2 >= '-1'::integer))
(3 rows)
-- This query crashes with an Assert
select distinct on(s0, s1) * from mv where t2 >= -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_argument)));
The problem is "array->low_compare" changing "t1<10" to "t1>10" because t1
order is DESC.
From | Date | Subject | |
---|---|---|---|
Next Message | PG Bug reporting form | 2025-09-11 13:23:05 | BUG #19050: psql: could not find digest for NID UNDEF |
Previous Message | PG Bug reporting form | 2025-09-11 07:43:54 | BUG #19048: PostgreSQL Windows Turkish Search Problem |