Skip to content

PG19: columnar CREATE INDEX fails (parallel-scan callbacks + serialization) #8611

Description

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions