Skip to content

Conversation

@kk-src
Copy link
Contributor

@kk-src kk-src commented Nov 21, 2025

Summary:

This PR ports Apache AGE to work with PG18

[PG18 port][Set1] Fix header dependencies and use TupleDescAttr macro
[PG18 port][Set2] Adapt to expandRTE signature change and pg_noreturn
[PG18 port][Set3] Fix double ExecOpenIndices call for PG18 compatibility
[PG18 port][Set4] Update regression test expected output for ordering

Testing:

ok 1         - scan                                      477 ms
ok 2         - graphid                                    22 ms
ok 3         - agtype                                    290 ms
ok 4         - agtype_hash_cmp                            16 ms
ok 5         - catalog                                   263 ms
ok 6         - cypher                                     94 ms
ok 7         - expr                                     1300 ms
ok 8         - cypher_create                             253 ms
ok 9         - cypher_match                             1173 ms
ok 10        - cypher_unwind                              94 ms
ok 11        - cypher_set                                263 ms
ok 12        - cypher_remove                             148 ms
ok 13        - cypher_delete                             372 ms
ok 14        - cypher_with                               138 ms
ok 15        - cypher_vle                               2146 ms
ok 16        - cypher_union                               47 ms
ok 17        - cypher_call                                63 ms
ok 18        - cypher_merge                              611 ms
ok 19        - cypher_subquery                           139 ms
ok 20        - age_global_graph                          280 ms
ok 21        - age_load                                 3263 ms
ok 22        - index                                     169 ms
ok 23        - analyze                                    41 ms
ok 24        - graph_generation                          142 ms
ok 25        - name_validation                           300 ms
ok 26        - jsonb_operators                           206 ms
ok 27        - list_comprehension                        117 ms
ok 28        - map_projection                             63 ms
ok 29        - drop                                      662 ms
1..29
# All 29 tests passed.

@jrgemignani
Copy link
Contributor

@MuhammadTahaNaveed @kk-src I built this locally and it builds without errors. I have not reviewed the code, though.

@jrgemignani
Copy link
Contributor

@kk-src It looks like this PR isn't up-to-date with this [PG18] branch and is based off the master branch. I would recommend rebasing it against this branch to be safe. Or, we use the rebase and merge option. @MuhammadTahaNaveed thoughts?

Copy link
Contributor

@jrgemignani jrgemignani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kk-src Looks good less minor changes requested.

Include executor/executor.h for PG18 header reorganization and use
TupleDescAttr() accessor macro instead of direct attrs[] access.

Note: Assisted by GitHub Copilot Agent mode.
- Add VarReturningType parameter to expandRTE() calls using VAR_RETURNING_DEFAULT.
- Replace pg_attribute_noreturn() with pg_noreturn prefix specifier.

Note: Assisted by GitHub Copilot Agent mode.
PG18 enforces stricter assertions in ExecOpenIndices, requiring
ri_IndexRelationDescs to be NULL when called.

In update_entity_tuple(), indices may already be opened by the
caller (create_entity_result_rel_info), causing assertion failures.

Add a check to only open indices if not already open, and track
ownership with a boolean flag to ensure we only close what we opened.

Found when regression tests failed with assertions, which this change
resolves.

Note: Assisted by GitHub Copilot Agent mode.
PG18's implementation changes result in different row ordering for
queries without explicit ORDER BY clauses. Update expected output
files to reflect the new ordering while maintaining identical
result content.

Note: Assisted by GitHub Copilot Agent mode.
Copy link
Contributor

@jrgemignani jrgemignani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - approve.

@MuhammadTahaNaveed Still needs to approve it before merging it.

@jrgemignani
Copy link
Contributor

@kk-src @MuhammadTahaNaveed It also ran the issue the other PR had, and, without issue -

#2165 (comment)

@kk-src
Copy link
Contributor Author

kk-src commented Nov 24, 2025

The commits with signing has been updated as well. Please let me know next steps.

@jrgemignani
Copy link
Contributor

The commits with signing has been updated as well. Please let me know next steps.

Right now, the next steps are our reviews.

Copy link
Member

@MuhammadTahaNaveed MuhammadTahaNaveed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@MuhammadTahaNaveed MuhammadTahaNaveed merged commit 146bf38 into apache:PG18 Nov 25, 2025
3 of 7 checks passed
@MuhammadTahaNaveed
Copy link
Member

@kk-src Thank you for your valuable contribution.

MuhammadTahaNaveed pushed a commit that referenced this pull request Jan 21, 2026
* Updated CI, Labeler, Docker, and branch security files for PG18 (#2246)

Updated the CI and Docker files for the PG18
Updated the labeler and branch security files for PG18.

Some of these only apply to the master branch but are updated
for consistency.

modified:   .asf.yaml
modified:   .github/labeler.yml
modified:   .github/workflows/go-driver.yml
modified:   .github/workflows/installcheck.yaml
modified:   .github/workflows/jdbc-driver.yaml
modified:   .github/workflows/nodejs-driver.yaml
modified:   .github/workflows/python-driver.yaml
modified:   docker/Dockerfile
modified:   docker/Dockerfile.dev
modified:   drivers/docker-compose.yml

* PG18 port for AGE (#2251)

* [PG18 port][Set1] Fix header dependencies and use TupleDescAttr macro

- Include executor/executor.h for PG18 header reorganization and use 
  TupleDescAttr() accessor macro instead of direct attrs[] access.

* [PG18 port][Set2] Adapt to expandRTE signature change and pg_noreturn

- Add VarReturningType parameter to expandRTE() calls using VAR_RETURNING_DEFAULT.
- Replace pg_attribute_noreturn() with pg_noreturn prefix specifier.

* [PG18 port][Set3] Fix double ExecOpenIndices call for PG18 compatibility

- PG18 enforces stricter assertions in ExecOpenIndices, requiring
  ri_IndexRelationDescs to be NULL when called.

- In update_entity_tuple(), indices may already be opened by the
  caller (create_entity_result_rel_info), causing assertion failures.

- Add a check to only open indices if not already open, and track
  ownership with a boolean flag to ensure we only close what we opened.

- Found when regression tests failed with assertions, which this change
  resolves.

* [PG18 port][Set4] Update regression test expected output for ordering

PG18's implementation changes result in different row ordering for
queries without explicit ORDER BY clauses. Update expected output
files to reflect the new ordering while maintaining identical
result content.

* [PG18 port][Set5] Address review comments - coding standard fix

Note: Assisted by GitHub Copilot Agent mode.

* Fix DockerHub build warning messages (#2252)

PR fixes build warning messages on DockerHub and on my local build.

No regression tests needed.

modified:   src/include/nodes/ag_nodes.h
modified:   src/include/optimizer/cypher_createplan.h
modified:   src/include/optimizer/cypher_pathnode.h
modified:   tools/gen_keywordlist.pl

---------
Co-authored-by: Krishnakumar R (KK) <65895020+kk-src@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants