Re: GIN jsonpath scans miss rows when methods follow a predicate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: GIN jsonpath scans miss rows when methods follow a predicate
Date: 2026-10-14 01:25:10
Message-ID: 1119035.1791941110@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> Codex reported me an issue where GIN scans can miss matching rows when
> methods are applied to a jsonpath predicate's result.
> SELECT * FROM t WHERE j @@ '($ == 1).size().boolean()';

This is related to one of the bugs I fixed in b28a2b2bf, but I think
it's different. I fear your patch might be too sweeping though ---
are you sure it doesn't reject cases that would be valid? I'd prefer
to inject the no-nextPos test on a per-node-type basis.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-10-14 01:39:53 Re: pg_upgrade fails with a config-only datadir and no --new-bindir
Previous Message Michael Paquier 2026-10-14 01:18:57 Re: Memory leak in statext_ndistinct_build() during ANALYZE