Repository navigation
Commit 704c852
committed
Support building against PostgreSQL 19
Note: A big thank you to Alexander Kukushkin <cyberdemn@gmail.com>
who's work helped to make this possible.
Adapt AGE to PostgreSQL 19's C API changes so the extension compiles
cleanly (verified with COPT=-Werror) and passes the full regression
suite against 19beta1. Each prototype change was matched to how AGE
actually uses the function rather than blindly appending arguments.
Access-method scans: table_beginscan() and index_beginscan() gained a
trailing uint32 flags. Pass SO_NONE (no special scan options);
table_beginscan() still ORs in SO_TYPE_SEQSCAN internally, so behavior is
unchanged. Add access/genam.h to the files that use index_*/IndexScanDesc
(previously reached only transitively through now-leaner PG headers).
Tuple-slot init: MakeTupleTableSlot() and ExecInitScanTupleSlot() gained a
uint16 flags. Pass 0. AGE's DML executors are CustomScanState nodes whose
input tuples are synthesized agtype rows, so -- like PostgreSQL's own
nodeCustom.c and nodeSubqueryscan.c -- 0 is correct. The
TTS_FLAG_OBEYS_NOT_NULL_CONSTRAINTS hint that heap seq/index scans pass
would be unsound here since these tuples are not guaranteed to obey a base
relation's NOT NULL constraints.
DML tuple ops: heap_delete() added a uint32 options argument and dropped
the trailing changingPart bool; table_tuple_update() added a uint32 options
argument. Pass 0 in both (AGE used changingPart=false and no special
options, so 0 preserves behavior).
ExecInsertIndexTuples() was reworked to
(resultRelInfo, estate, uint32 flags, slot, arbiterIndexes, specConflict)
with flags EIIT_IS_UPDATE / EIIT_NO_DUPE_ERROR / EIIT_ONLY_SUMMARIZING. The
old booleans map to flags: plain inserts (cypher_utils) use 0; SET uses
EIIT_ONLY_SUMMARIZING when update_indexes == TU_Summarizing. Importantly,
the bulk loader (age_load) previously passed noDupErr=true so it could
detect the conflict list and raise its own error; this maps to
EIIT_NO_DUPE_ERROR (not 0), preserving AGE's "Cannot insert duplicate
vertex id" message instead of surfacing the raw unique-constraint violation.
CreateSchemaCommand() replaced its const char *queryString parameter with a
ParseState *. Build one with make_parsestate(), set p_sourcetext to the
generated command string, and free_parsestate() afterward (mirroring
standard_ProcessUtility). The argument count is unchanged, so this mismatch
only warns under default flags -- another reason the build uses -Werror.
Shared-memory/locks: LWLockNewTrancheId() now takes the tranche name
directly and LWLockRegisterTranche() was removed; GetNamedDSMSegment() and
its init callback gained a void *arg. Update the graph-version DSM setup
accordingly, passing NULL for the unused callback argument.
Miscellaneous: add includes exposed by leaner PG19 headers (catalog/pg_type.h
for TEXTOID/CHAROID, <time.h> for CLOCK_REALTIME, utils/tuplesort.h and
utils/tuplestore.h, access/htup_details.h for GETSTRUCT/heap_form_tuple);
PointerIsValid() was removed (use != NULL); VARDATA()/VARSIZE() now require a
pointer, so wrap the Datum in DatumGetPointer(); replace the fall-through
comment with the pg_fallthrough macro; and const-qualify JumbleState * in the
post_parse_analyze hook signature.
Regression output: the only differences under PG19 are cosmetic and are
reflected in the expected files. PostgreSQL 19 reworded undefined
function/operator errors -- the "HINT: No function/operator matches the given
name and argument types" line became "DETAIL: No function/operator of that
name accepts...", and for a wholly unknown operator "DETAIL: There is no
operator of that name."; the ERROR lines themselves are unchanged. This
accounts for the expr, cypher_call, jsonb_operators and subgraph updates.
Separately, a divergent-path query in cypher_match returned the same four
paths in a different, non-deterministic order under PG19; add ORDER BY p to
make it deterministic (matching the project's practice of ordering
non-deterministic RETURN queries). The returned row multiset is unchanged --
it is purely a reordering, not a data difference.
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Alexander Kukushkin <cyberdemn@gmail.com>
modified: regress/expected/cypher_call.out
modified: regress/expected/cypher_match.out
modified: regress/expected/expr.out
modified: regress/expected/jsonb_operators.out
modified: regress/expected/subgraph.out
modified: regress/sql/cypher_match.sql
modified: src/backend/catalog/ag_label.c
modified: src/backend/commands/graph_commands.c
modified: src/backend/executor/cypher_create.c
modified: src/backend/executor/cypher_delete.c
modified: src/backend/executor/cypher_merge.c
modified: src/backend/executor/cypher_set.c
modified: src/backend/executor/cypher_utils.c
modified: src/backend/parser/cypher_analyze.c
modified: src/backend/parser/cypher_expr.c
modified: src/backend/parser/cypher_keywords.c
modified: src/backend/utils/adt/age_global_graph.c
modified: src/backend/utils/adt/age_vle.c
modified: src/backend/utils/adt/agtype.c
modified: src/backend/utils/adt/agtype_ops.c
modified: src/backend/utils/adt/agtype_util.c
modified: src/backend/utils/load/age_load.c
modified: .github/workflows/installcheck.yaml
Resolved conflicts: .github/workflows/installcheck.yaml1 parent 9088e01 commit 704c852
22 files changed
Lines changed: 172 additions & 141 deletions
File tree
- regress
- expected
- sql
- src/backend
- catalog
- commands
- executor
- parser
- utils
- adt
- load
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
| |||
287 | 286 | | |
288 | 287 | | |
289 | 288 | | |
290 | | - | |
| 289 | + | |
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
295 | | - | |
296 | 294 | | |
297 | 295 | | |
298 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
339 | | - | |
340 | 340 | | |
341 | | - | |
342 | 341 | | |
| 342 | + | |
| 343 | + | |
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| |||
1494 | 1495 | | |
1495 | 1496 | | |
1496 | 1497 | | |
1497 | | - | |
| 1498 | + | |
1498 | 1499 | | |
1499 | 1500 | | |
1500 | 1501 | | |
1501 | 1502 | | |
1502 | 1503 | | |
1503 | 1504 | | |
1504 | | - | |
| 1505 | + | |
1505 | 1506 | | |
1506 | 1507 | | |
1507 | 1508 | | |
| |||
0 commit comments