Part of the PG19 support umbrella: #8597.
Surfaced by review of #8602 (the ruleutils_19.c port). The Phase-1
build only provides a type shim; the command-dispatch behaviour is
deferred to this issue.
Background
PG19 replaced ClusterStmt with the unified RepackStmt, which also
subsumes VACUUM FULL. The parse-node tag T_ClusterStmt no longer
exists; T_RepackStmt is its successor, and the member layout differs
(relation is now a VacuumRelation * rather than a RangeVar *, plus
new repack options).
For the Phase-1 build foundation we added a minimal source-level shim in
src/include/pg_version_compat.h:
typedef struct RepackStmt ClusterStmt;
#define T_ClusterStmt T_RepackStmt
This makes the type names and node-tag references compile, but it is
not correct command behaviour:
T_ClusterStmt now aliases T_RepackStmt, so castNode(ClusterStmt, ...)
and any switch on the node tag that means "this is CLUSTER" will
also fire for REPACK and VACUUM FULL-via-REPACK. These are
distinct operations on a distributed table and must be told apart.
- Member access to
clusterStmt->relation / ->indexname is laid out
differently on RepackStmt and is currently only guarded at the
RangeVarGetRelid call in cluster.c, not adapted everywhere.
GetDistributeObjectOps() dispatch keys off the original
T_ClusterStmt tag; on PG19 it needs to recognise T_RepackStmt and
route REPACK / CLUSTER / VACUUM FULL to the right distributed-object
operations.
Scope
- Discriminate REPACK vs CLUSTER vs VACUUM FULL on PG19 at the utility
dispatch boundary (commands/utility_hook.c and the
GetDistributeObjectOps() switch).
- Adapt
cluster.c / relay_event_utility.c member access for the
RepackStmt layout (version-guarded).
- Decide and document Citus' propagation semantics for the new
REPACK
command on distributed/reference/local tables.
Validation
Cross-version gate (required before commit): build under -Werror and
run the relevant regress schedule on PG17.10, PG18.4, and PG19beta1 —
all three green, PG17/PG18 regression-neutral.
- PG19:
CLUSTER, REPACK, and VACUUM FULL on distributed tables
dispatch and propagate correctly.
- PG17/18: regression neutral (the
RepackStmt typedef/macro shim is
compiled out; behaviour unchanged).
Plan detail: pg19-pr-plan/11-repack-cluster-command.md (PR11).
Part of the PG19 support umbrella: #8597.
Surfaced by review of #8602 (the
ruleutils_19.cport). The Phase-1build only provides a type shim; the command-dispatch behaviour is
deferred to this issue.
Background
PG19 replaced
ClusterStmtwith the unifiedRepackStmt, which alsosubsumes
VACUUM FULL. The parse-node tagT_ClusterStmtno longerexists;
T_RepackStmtis its successor, and the member layout differs(
relationis now aVacuumRelation *rather than aRangeVar *, plusnew repack options).
For the Phase-1 build foundation we added a minimal source-level shim in
src/include/pg_version_compat.h:This makes the type names and node-tag references compile, but it is
not correct command behaviour:
T_ClusterStmtnow aliasesT_RepackStmt, socastNode(ClusterStmt, ...)and any
switchon the node tag that means "this is CLUSTER" willalso fire for
REPACKandVACUUM FULL-via-REPACK. These aredistinct operations on a distributed table and must be told apart.
clusterStmt->relation/->indexnameis laid outdifferently on
RepackStmtand is currently only guarded at theRangeVarGetRelidcall incluster.c, not adapted everywhere.GetDistributeObjectOps()dispatch keys off the originalT_ClusterStmttag; on PG19 it needs to recogniseT_RepackStmtandroute REPACK / CLUSTER / VACUUM FULL to the right distributed-object
operations.
Scope
dispatch boundary (
commands/utility_hook.cand theGetDistributeObjectOps()switch).cluster.c/relay_event_utility.cmember access for theRepackStmtlayout (version-guarded).REPACKcommand on distributed/reference/local tables.
Validation
Cross-version gate (required before commit): build under
-Werrorandrun the relevant regress schedule on PG17.10, PG18.4, and PG19beta1 —
all three green, PG17/PG18 regression-neutral.
CLUSTER,REPACK, andVACUUM FULLon distributed tablesdispatch and propagate correctly.
RepackStmttypedef/macro shim iscompiled out; behaviour unchanged).
Plan detail:
pg19-pr-plan/11-repack-cluster-command.md(PR11).