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@gmail.com> (offlist)
Discussion: https://www.postgresql.org/message-id/CADfhSr-pCkbDxmiOVYSAGE5QGjsQ48KKH_W424SPk%2BpwzKZFaQ%40mail.gmail.com
*
* PK indexes are always btree, which supports SK_SEARCHARRAY.
*
- * Reference index_attnos[0] for attribute number and collation since this
- * is a single-column fast path.
+ * This path handles single-column FKs only, so index_attnos[0] == 1.
*/
Assert(idx_rel->rd_indam->amsearcharray);
+ Assert(fpmeta->index_attnos[0] == 1);
ScanKeyEntryInitialize(&skey[0],
SK_SEARCHARRAY,
fpmeta->index_attnos[0],