pgsql: Assert index_attnos[0] == 1 in ri_FastPathFlushArray()

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Assert index_attnos[0] == 1 in ri_FastPathFlushArray()
Date: 2026-04-10 06:28:30
Message-ID: E1wB5Lx-000G3o-2Y@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Assert index_attnos[0] == 1 in ri_FastPathFlushArray()

ri_FastPathFlushArray() handles single-column FKs only, so
index_attnos[0] is always 1. Add an Assert to make this invariant
explicit, as a followup to 980c1a85d819.

Suggested-by: Junwang Zhao <zhjwpku(at)gmail(dot)com> (offlist)
Discussion: https://www.postgresql.org/message-id/CADfhSr-pCkbDxmiOVYSAGE5QGjsQ48KKH_W424SPk%2BpwzKZFaQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/155c03ee9d449589fa93aabcac41d643d03875b9

Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Richard Guo 2026-04-10 06:51:43 pgsql: Fix var_is_nonnullable() to account for varreturningtype
Previous Message Amit Langote 2026-04-10 04:34:46 pgsql: Fix FK fast-path scan key ordering for mismatched column order