pgsql: BRIN: be more strict about required support procs

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: BRIN: be more strict about required support procs
Date: 2025-03-11 11:52:15
Message-ID: E1try9f-001vFR-07@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

BRIN: be more strict about required support procs

With improperly defined operator classes, it's possible to get a
Postgres crash because we'd try to invoke a procedure that doesn't
exist. This is because the code is being a bit too trusting that the
opclass is correctly defined. Add some ereport(ERROR)s for cases where
mandatory support procedures are not defined, transforming the crashes
into errors.

The particular case that was reported is an incomplete opclass in
PostGIS.

Backpatch all the way down to 13.

Reported-by: Tobias Wendorff <tobias(dot)wendorff(at)tu-dortmund(dot)de>
Diagnosed-by: David Rowley <dgrowleyml(at)gmail(dot)com>
Reviewed-by: Tomas Vondra <tomas(at)vondra(dot)me>
Discussion: https://postgr.es/m/fb6d9a35-6c8e-4869-af80-0a4944a793a4@tu-dortmund.de

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5144e1f8fddeab4b3a6fec5d2b734402f1a5462b

Modified Files
--------------
src/backend/access/brin/brin_bloom.c | 19 +++++-------------
src/backend/access/brin/brin_inclusion.c | 31 +++++++++++++++++------------
src/backend/access/brin/brin_minmax_multi.c | 19 +++++-------------
3 files changed, 28 insertions(+), 41 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-03-11 12:48:23 pgsql: Update nls.mk for newly added file
Previous Message Álvaro Herrera 2025-03-11 11:52:14 pgsql: BRIN: be more strict about required support procs