dbeaver / dbeaver/dbeaver

Syntax analyser vs PostgreSQL daterange

Open
#39,461 1 comment 0 reactions 0 assignees View on GitHub
x:postgresql xf:sql editor
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 13h
Merged PRs (30d)
183

Description

### Description

Hello.
I use daterange with PostgreSQL and saw that syntax analyzer in editor view seems to be confused by this PosgreSQL operator for ranges : &&

### DBeaver Version

Community version Version 25.2.0.202508311659

### Operating System

Windows 11

### Database and driver

PostgreSQL 16.9 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-26), 64-bit

### Steps to reproduce

drop table if exists public.newtable;

CREATE TABLE public.newtable (
id bigserial NOT NULL,
validity daterange NULL
);

insert into public.newtable (validity) values (daterange('2025-01-01','2025-07-01'));
insert into public.newtable (validity) values (daterange('2025-01-01','2026-01-01'));
insert into public.newtable (validity) values (daterange('2026-01-01',null));

select * from public.newtable order by 1;
-- 1 [2025-01-01,2025-07-01)
-- 2 [2025-01-01,2026-01-01)
-- 3 [2026-01-01,)

-- select current and futures rows
select * from public.newtable where validity && daterange(current_date,null); -- <-- syntax analyzer does'nt understand this order... '&&' confusing ??

-- 2 [2025-01-01,2026-01-01)
-- 3 [2026-01-01,)

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.