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: Fix infer_arbiter_index for partitioned tables
Date: Thu, 11 Dec 2025 19:58:03 +0000
Message-ID: <E1vTmna-000CwK-05@gemulon.postgresql.org> (raw)

Fix infer_arbiter_index for partitioned tables

The fix for concurrent index operations in bc32a12e0db2 started
considering indexes that are not yet marked indisvalid as arbiters for
INSERT ON CONFLICT.  For partitioned tables, this leads to including
indexes that may not exist in partitions, causing a trivially
reproducible "invalid arbiter index list" error to be thrown because of
failure to match the index.  To fix, it suffices to ignore !indisvalid
indexes on partitioned tables.  There should be no risk that the set of
indexes will change for concurrent transactions, because in order for
such an index to be marked valid, an ALTER INDEX ATTACH PARTITION must
run which requires AccessExclusiveLock.

Author: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/17622f79-117a-4a44-aa8e-0374e53faaf0%40gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/81f72115cf189b0a428d3efca2e4beb02b825111

Modified Files
--------------
src/backend/optimizer/util/plancat.c         | 9 +++++++++
src/test/regress/expected/partition_info.out | 7 +++++++
src/test/regress/sql/partition_info.sql      | 8 ++++++++
3 files changed, 24 insertions(+)



Message-ID: <E1vTmna-000CwK-05@gemulon.postgresql.org>
Permalink:  ../E1vTmna-000CwK-05@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vTmna-000CwK-05@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: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix infer_arbiter_index for partitioned tables
  In-Reply-To: <E1vTmna-000CwK-05@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