You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Conflicting NULL row not refused with NULLS NOT DISTINCT and bloom filters in compressed DMLย #10579
NULL check issues combined with bloom sparse indexing
TimescaleDB version affected
main
PostgreSQL version used
18.6
What operating system did you use?
arch
What installation method did you use?
Source
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
How can we reproduce the bug?
-- On a compressed hypertable with a NULLS NOT DISTINCT unique constraint,
-- INSERT ... ON CONFLICT DO NOTHING inserts a duplicate NULL row when a
-- single-column bloom sparse index on the conflict column prunes the
-- conflict-check scan.
create table sensor_log(
recorded_at timestamptz not null,
sensor_id int,
reading int,
unique nulls not distinct (sensor_id, recorded_at)
);selectcreate_hypertable('sensor_log','recorded_at');
alter table sensor_log set (timescaledb.enable_columnstore = true,
timescaledb.orderby = 'recorded_at',
timescaledb.sparse_index = 'bloom(sensor_id)');
insert into sensor_log values ('2026-01-10 00:50', 1, 1);
insert into sensor_log values ('2026-01-10 00:51', null, 1);selectcompress_chunk(show_chunks('sensor_log'));
-- baseline: without bloom pruning the conflict is found and nothing is inserted
set timescaledb.enable_sparse_index_bloom = off;
insert into sensor_log values ('2026-01-10 00:51', null, 2)
on conflict (sensor_id, recorded_at) do nothing;
-- the same insert with the default setting
reset timescaledb.enable_sparse_index_bloom;
insert into sensor_log values ('2026-01-10 00:51', null, 2)
on conflict (sensor_id, recorded_at) do nothing; -- INSERT 0 1, expected INSERT 0 0
select* from sensor_log where sensor_id is null; -- two rows for the same key
Activity