Part of the PG19 support umbrella: #8597.
On PG19, CREATE INDEX on a columnar table aborts with
ERROR: columnar_parallelscan_estimate not implemented. Two fixes to the
columnar TableAM, both required to get CREATE INDEX working on PG19.
1. Provide working parallel-scan callbacks
PG19's parallel btree index-build path unconditionally calls the
TableAM's parallelscan_estimate / parallelscan_initialize callbacks
even when the scan runs serially. Columnar's callbacks elog(ERROR).
Delegate to the heap-block helpers; columnar still never reads the
parallel-scan descriptor, so any state written is simply unused.
2. Serialize CREATE INDEX on columnar tables
PG19 can issue concurrent index builds against the same columnar
relation; stripe-write metadata is not safe for concurrent writers. Take
a per-relation lock during columnar index builds on PG19, only when the
build is against a columnar AM (heap index builds unaffected).
Validation
PG17.10 / PG18.4 / PG19devel build green under -Werror; on PG19
CREATE INDEX on columnar tables succeeds and concurrent builds
serialize cleanly. PG17/18 regression-neutral (callbacks were
elog(ERROR) and never reached there).
Plan detail: pg19-pr-plan/03-columnar-parallel-and-index.md (PR3).
Part of the PG19 support umbrella: #8597.
On PG19,
CREATE INDEXon a columnar table aborts withERROR: columnar_parallelscan_estimate not implemented. Two fixes to thecolumnar TableAM, both required to get
CREATE INDEXworking on PG19.1. Provide working parallel-scan callbacks
PG19's parallel btree index-build path unconditionally calls the
TableAM's
parallelscan_estimate/parallelscan_initializecallbackseven when the scan runs serially. Columnar's callbacks
elog(ERROR).Delegate to the heap-block helpers; columnar still never reads the
parallel-scan descriptor, so any state written is simply unused.
2. Serialize CREATE INDEX on columnar tables
PG19 can issue concurrent index builds against the same columnar
relation; stripe-write metadata is not safe for concurrent writers. Take
a per-relation lock during columnar index builds on PG19, only when the
build is against a columnar AM (heap index builds unaffected).
Validation
PG17.10 / PG18.4 / PG19devel build green under
-Werror; on PG19CREATE INDEXon columnar tables succeeds and concurrent buildsserialize cleanly. PG17/18 regression-neutral (callbacks were
elog(ERROR)and never reached there).Plan detail:
pg19-pr-plan/03-columnar-parallel-and-index.md(PR3).