Support PostgreSQL 19#2427
Open
CyberDem0n wants to merge 2 commits into
Open
Conversation
Contributor
|
@CyberDem0n Build failed |
Author
|
@jrgemignani changed to gnu11, now it should work |
Contributor
|
@CyberDem0n We will need to review this and also our strategy on how to support/release PG19. |
Contributor
|
@CyberDem0n Could you change the branch to apply to from master to PG19 please :) I am not able to for some reason. Additionally, if you could rebase the PR against the PG19 branch and note that I changed the |
code cleanly compiles and tests pass difference in tests output mainly caused by changes in Postgres error reporting.
jrgemignani
added a commit
that referenced
this pull request
Jul 6, 2026
Note: A big thank you to Alexander Kukushkin <cyberdemn@gmail.com>
who's work helped to make this possible. #2427
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.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Code cleanly compiles and tests pass.
Difference in tests output mainly caused by changes in Postgres error reporting.