pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Drop opcintype from index AM strategy translation API
Date: Fri, 21 Feb 2025 08:14:17 +0000
Message-ID: <E1tlOAs-000R8j-2y@gemulon.postgresql.org> (raw)

Drop opcintype from index AM strategy translation API

The type argument wasn't actually really necessary.  It was a remnant
of converting the API of the gist strategy translation from using
opclass to using opfamily+opcintype (commits c09e5a6a016,
622f678c102).  For looking up the gist translation function, we used
the convention "amproclefttype = amprocrighttype = opclass's
opcintype" (see pg_amproc.h).  But each operator family should only
have one translation function, and getting the right type for the
lookup is sometimes cumbersome and fragile, so this is all
unnecessarily complicated.

To simplify this, change the gist stategy support procedure to take
"any", "any" as argument.  (This is arbitrary but seems intuitive.
The alternative of using InvalidOid as argument(s) upsets various DDL
commands, so it's not practical.)  Then we don't need opcintype for
the lookup, and we can remove it from all the API layers introduced by
commit c09e5a6a016.

This also adds some more documentation about the correct signature of
the gist support function and adds more checks in gistvalidate().
This was previously underspecified.  (It relied implicitly on
convention mentioned above.)

Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7d6d2c4bbd730bd9af191d46d4fb01d5f5c30cf1

Modified Files
--------------
contrib/btree_gist/btree_gist--1.7--1.8.sql | 52 ++++++++++++++---------------
doc/src/sgml/gist.sgml                      |  6 ++++
src/backend/access/gist/gistutil.c          |  4 +--
src/backend/access/gist/gistvalidate.c      |  4 ++-
src/backend/access/hash/hash.c              |  4 +--
src/backend/access/index/amapi.c            |  8 ++---
src/backend/access/nbtree/nbtree.c          |  4 +--
src/backend/catalog/index.c                 |  1 -
src/backend/commands/indexcmds.c            |  2 +-
src/backend/commands/tablecmds.c            |  2 +-
src/backend/executor/execReplication.c      |  2 +-
src/backend/replication/logical/relation.c  |  6 ++--
src/include/access/amapi.h                  |  8 ++---
src/include/access/gist.h                   |  2 +-
src/include/access/hash.h                   |  4 +--
src/include/access/nbtree.h                 |  4 +--
src/include/catalog/catversion.h            |  2 +-
src/include/catalog/pg_amproc.dat           | 24 ++++++-------
18 files changed, 72 insertions(+), 67 deletions(-)



Message-ID: <E1tlOAs-000R8j-2y@gemulon.postgresql.org>
Permalink:  ../E1tlOAs-000R8j-2y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tlOAs-000R8j-2y@gemulon.postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Drop opcintype from index AM strategy translation API
  In-Reply-To: <E1tlOAs-000R8j-2y@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