pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use indnkeyatts, not indnatts, in infer_collation_opclass_match(
Date: Wed, 25 Nov 2026 17:48:44 +0000
Message-ID: <E1xWH6q-00000000IRm-358t@gemulon.postgresql.org> (raw)

Use indnkeyatts, not indnatts, in infer_collation_opclass_match()

rd_indcollation, rd_opfamily and rd_opcintype only have entries for key
columns, so loops that read them must be bounded by indnkeyatts, not
indnatts.  The function patched here was neglected in commit
386e3d7609c4 "CREATE INDEX ... INCLUDING (column[, ...])" dated April
2016; backpatch all the way back.

Author: Jian He <jian.universality@gmail.com>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Backpatch-through: 15
Discussion: https://postgr.es/m/CACJufxGWVB6dwPaQz25eXm-sdcxOWNfbfTHUd5wG41-zDcG6OA@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f4f9a710f57b717eaa82e98b02aa3a6d81319db7

Modified Files
--------------
src/backend/commands/analyze.c       | 4 ++++
src/backend/optimizer/util/plancat.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1xWH6q-00000000IRm-358t@gemulon.postgresql.org>
Permalink:  ../E1xWH6q-00000000IRm-358t@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xWH6q-00000000IRm-358t@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 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: alvherre@kurilemu.de
  Subject: Re: pgsql: Use indnkeyatts, not indnatts, in infer_collation_opclass_match(
  In-Reply-To: <E1xWH6q-00000000IRm-358t@gemulon.postgresql.org>
  References: <E1xWH6q-00000000IRm-358t@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