Re: [PATCH] btree_gist: add cross-type integer operator support for GiST

From: Alexander Nestorov <alexandernst(at)gmail(dot)com>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Maxime Schoemans <maxime(dot)schoemans(at)enterprisedb(dot)com>, pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: [PATCH] btree_gist: add cross-type integer operator support for GiST
Date: 2026-07-04 23:00:19
Message-ID: 52379f05-166d-4f51-9fc1-27765cd30e9f@Spark
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hey all!

I noticed in the commitfest tracker that the patchset stopped passing all the
tests. It seems that several commits that were recently merged are conflicting
with this patchset. Specifically:

- 4b808ed77cd "Sync signatures of gbt_var_consistent() and gbt_num_consistent()"

gbt_num_consistent() now takes the strategy by value instead of by pointer, so
I had to change the call sites in my code.

- eef644e57c3 "Fix btree_gist's NotEqual strategy on internal index pages"

splits the <> handling into separate leaf and internal cases.

- fea9c1884b2 "Tighten up btree_gist's handling of truncated bounds" (and its
follow-up b82d69abf64)

restructured gbt_num_consistent() around the new lower_is_below_query() /
upper_is_above_query() helpers and calls callbacks as f(key, query), but my code
did it the other way around (f(query, key)).

I kept upstream's new leaf/internal split, the NotEqual fix and the two helper
macros verbatim, and only flipped each comparison to query-first. The result is
semantically identical to upstream for the same-type case, while preserving the
fixed argument order the cross-type callbacks depend on. On the caller side, the
int2/int4/int8 consistent() functions now pass the strategy by value to match
the new signature.

There are no functional changes to the patchset itself and all tests pass.
Attaching v6, rebased on top of a8c2547e.

PD: Adding Tom Lane (tgl) to CC as I noticed he added himself as a committer.

Best regards!

Attachment Content-Type Size
v6-0001-Implement-cross-type-operators-for-GiST-indexes.patch application/octet-stream 32.4 KB
v6-0002-Add-tests-for-cross-type-operators-for-GiST-indexes.patch application/octet-stream 25.8 KB
v6-0003-doc-Document-cross-type-operator-support-in-btree_gi.patch application/octet-stream 2.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-07-04 23:09:19 Re: Remove getpgusername()
Previous Message Heikki Linnakangas 2026-07-04 22:57:53 Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore