From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove RI fast-path code for calling cast functions
Date: Thu, 15 Oct 2026 08:06:43 +0000
Message-ID: <E1xHGU7-00000001hyh-1O6W@gemulon.postgresql.org> (raw)
Remove RI fast-path code for calling cast functions
The previous commit stopped using the fast path when FK values need a
cast function, which leaves its code for calling them unused. So
remove the following: the cached FmgrInfos for the cast and equality
functions and the memory context they used, the cast step in
build_index_scankeys(), the EXECUTE privilege check on the cast
function, and the unused forward declaration of RI_CompareHashEntry.
Also revert the changes made to ri_HashCompareOp() for the fast path's
cross-type operators and domain-typed keys in commits 2da86c1ef9 and
68ace967c1. Fast-path code no longer uses the function.
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Discussion: https://postgr.es/m/CAM527d9BgPjeOOYmbCBTd57R145qHCk-dzw9qNq+nOrDq1j__A@mail.gmail.com
Backpatch-through: 19
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/964d88fac464a9b5f55c3d0c9c2ec72bcde5847d
Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 137 ++++++++++--------------------------
1 file changed, 39 insertions(+), 98 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: amitlan@postgresql.org
Subject: Re: pgsql: Remove RI fast-path code for calling cast functions
In-Reply-To: <E1xHGU7-00000001hyh-1O6W@gemulon.postgresql.org>
References: <E1xHGU7-00000001hyh-1O6W@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox