Part of the PG19 support umbrella: #8597.
After the build foundation (#8601) the extension loads, but three PG19
changes crash backends in ordinary use (no regression harness
involved).
1. FuncnameGetCandidates writes to its new out-parameter
PG19 added an int *fgc_flags out-parameter. #8601 stubbed it by passing
NULL; PG19's catalog lookup dereferences that pointer, so any Citus
call that resolves a function by name crashes the backend. Fix: pass the
address of a compound-literal int instead of NULL.
2. TupleDesc.firstNonCachedOffsetAttr no longer populated by BlessTupleDesc()
PG19's per-TupleDesc offset cache is asserted-populated but no longer
filled in by BlessTupleDesc(). Citus builds many TupleDescs by hand
(intermediate-result tuplestores, EXPLAIN ANALYZE destinations, the
pg_stat_statements SRF descriptor). Add explicit TupleDescFinalize()
calls at those sites plus a pg_version_compat.h shim (wrap
BlessTupleDesc() on PG19; no-op TupleDescFinalize() on PG <= 18).
3. config_generic layout changed
PG19 turned the type-specific suffix into an embedded union. Citus' GUC
override in OverridePostgresConfigProperties() cast config_generic *
straight to config_string *, which now reads garbage and crashes when
the application_name assign hook fires. Access config_string via
var->_string on PG19, guarded by #if PG_VERSION_NUM >= PG_VERSION_19.
Validation
PG17.10 / PG18.4 / PG19devel build green under -Werror; PG17/PG18
regression-neutral. multi_cluster_management is the canonical PG19
reproducer for the TupleDesc bug.
Plan detail: pg19-pr-plan/02-runtime-non-regress.md (PR2).
Part of the PG19 support umbrella: #8597.
After the build foundation (#8601) the extension loads, but three PG19
changes crash backends in ordinary use (no regression harness
involved).
1.
FuncnameGetCandidateswrites to its new out-parameterPG19 added an
int *fgc_flagsout-parameter. #8601 stubbed it by passingNULL; PG19's catalog lookup dereferences that pointer, so any Cituscall that resolves a function by name crashes the backend. Fix: pass the
address of a compound-literal int instead of
NULL.2.
TupleDesc.firstNonCachedOffsetAttrno longer populated byBlessTupleDesc()PG19's per-
TupleDescoffset cache is asserted-populated but no longerfilled in by
BlessTupleDesc(). Citus builds manyTupleDescs by hand(intermediate-result tuplestores, EXPLAIN ANALYZE destinations, the
pg_stat_statementsSRF descriptor). Add explicitTupleDescFinalize()calls at those sites plus a
pg_version_compat.hshim (wrapBlessTupleDesc()on PG19; no-opTupleDescFinalize()on PG <= 18).3.
config_genericlayout changedPG19 turned the type-specific suffix into an embedded union. Citus' GUC
override in
OverridePostgresConfigProperties()castconfig_generic *straight to
config_string *, which now reads garbage and crashes whenthe
application_nameassign hook fires. Accessconfig_stringviavar->_stringon PG19, guarded by#if PG_VERSION_NUM >= PG_VERSION_19.Validation
PG17.10 / PG18.4 / PG19devel build green under
-Werror; PG17/PG18regression-neutral.
multi_cluster_managementis the canonical PG19reproducer for the TupleDesc bug.
Plan detail:
pg19-pr-plan/02-runtime-non-regress.md(PR2).