This is an automated email from the ASF dual-hosted git repository.
mtaha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/master by this push:
new d336d6df Master to PostgreSQL version 17 (#2197)
d336d6df is described below
commit d336d6dfeaea5ab8d5c6f429e32922998f02f117
Author: John Gemignani <[email protected]>
AuthorDate: Fri Aug 1 09:32:57 2025 -0700
Master to PostgreSQL version 17 (#2197)
Conflicts:
.asf.yaml
.github/workflows/installcheck.yaml
Changes to be committed:
modified: .asf.yaml
modified: .github/labeler.yml
modified: .github/workflows/installcheck.yaml
modified: README.md
modified: docker/Dockerfile
modified: docker/Dockerfile.dev
modified: drivers/docker-compose.yml
modified: src/backend/nodes/ag_nodes.c
modified: src/backend/parser/cypher_analyze.c
* Add support for PG17 (#2130)
- A new node type is introduced for JSON support, that is
JsonConstructorExpr - wrapper over FuncExpr/Aggref/WindowFunc for
SQL/JSON constructors.
- Added additional checks for JsonConstructorExpr expression node for
which the walker would crash.
- Removed palloc0fast function call (which is not available in PG17)
* Update CI, README and repo settings for PG17 (#2156)
- Currently, all workflows are targeting the `PG17_prepare` branch,
which will be changed to `PG17` once the branch is renamed.
- Updated all the github workflows
- Updated the README
- Updated repo settings
- Updated the Dockerfiles
* Remove stale bot and update .asf.yaml settings (#2171)
- Removed stale bot.
(https://lists.apache.org/thread/qh4h2z6hsjy2v7wg8mwfnl6cbjp28y08)
- Decrease required PR approvals by one.
(https://lists.apache.org/thread/kmz155t6k0h3b26fjpz36924zthqjlpm)
- Fixed a warning reported by apache infra i.e.
"An error occurred while processing the github
feature in .asf.yaml: GitHub discussions can
only be enabled if a mailing list target exists
for it."
* Update labeler.yml
Adjust workflow/labeler.yml to add permissions.
* Adjust CI for PG17 after rename from PG17_prepare (#2182)
Adjusted the following CI files (workflows) for PG17, they
originally pointed to PG17_prepare -
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: drivers/docker-compose.yml
modified: .github/labeler.yml
* Reimplement list comprehension (#2169) (#2188)
* Revert "Fix issue 1955 - List comprehension in WHERE clause (#2094)"
This reverts commit 0f0d9be9ba02fb90272d2053986f2b5aa4a0c25c.
* Revert "Fix error using list comprehension with WITH * (#1838)"
This reverts commit 5e08a2f58693adca55085da8d56eb1831d963d20.
* Revert "Fix shift/reduce conflict in grammar (#1719)"
This reverts commit fab3119a109280fd63237ce17c6d4dd60b7dfc03.
* Revert "Implement list comprehension (#1610)"
This reverts commit 3b2b394eb669c4f80fc893ad224cf5ea4e10c5a9.
* Reimplement list comprehension
- Reimplement list comprehension to use ARRAY sublinks.
- Some test results were not correct. All the test results that are
modified are correct and are verified with neo4j.
- Also resolves the issue of using list comprehension in MERGE clause (1611)
and issue 1850
* Add expression tree walkers for cypher nodes
- Added cypher_raw_expr_tree_walker and cypher_expr_tree_walker, based
on Postgres's raw_expression_tree_walker and expression_tree_walker.
These follow the same walker API as Postgres and add support for
Cypher-specific nodes.
- Also added the agtype[] to agtype func and typecast to 1.5.0-y.y.y.sql
- Simplifies logic for cypher_subquery handling in where clause.
- Fixes a crash when list comprehension in the WHERE clause references a
variable from the preceding MATCH clause.
* Add support for operators in cypher query (#2172)
- Fixed some operator signatures in .sql
- Added support for PG operators in cypher. Some
hardcoded operators are removed, since they are
now covered by the general operator handling.
- Added full typecast syntax that allows for type
modifiers.
- These changes also improve interoperability with
other extensions, as reflected in the regression
tests.
- Added a new function to check if graph_oid exists.
* Prevent object access hook from accesing not installed namespace (#2161)
Currently we cannot install Age to shared_preload_libraries if
pg_cron is installed.
To prevent following error we must bail out early.
postgres=# set backtrace_functions to 'get_namespace_oid';
SET
postgres=# create extension pg_cron ;
2025-04-15 16:59:49.867 +05 [30402] ERROR: schema "ag_catalog" does not
exist
2025-04-15 16:59:49.867 +05 [30402] BACKTRACE:
2 postgres 0x0000000102401ab0
get_namespace_oid + 204
3 age.so 0x0000000103285cd0
ag_catalog_namespace_id + 28
4 age.so 0x00000001032846fc
ag_relation_id + 32
5 age.so 0x00000001032efe9c
search_label_relation_cache_miss + 84
6 age.so 0x00000001032efe30
search_label_relation_cache + 100
7 age.so 0x00000001032842f4
object_access + 384
8 postgres 0x000000010240a7a0
RunObjectDropHook + 136
9 postgres 0x00000001023ee85c
deleteOneObject + 108
10 postgres 0x00000001023eb860
deleteObjectsInList + 476
11 postgres 0x00000001023eba14
performMultipleDeletions + 316
12 postgres 0x0000000102560244
ATPostAlterTypeCleanup + 2144
13 postgres 0x0000000102559fb4
ATRewriteCatalogs + 516
14 postgres 0x00000001025543a8
ATController + 284
15 postgres 0x00000001025541bc
AlterTable + 96
16 postgres 0x00000001028b8240
ProcessUtilitySlow + 1812
17 postgres 0x00000001028b600c
standard_ProcessUtility + 3684
18 age.so 0x00000001032844f8
ag_ProcessUtility_hook + 200
19 postgres 0x00000001028b516c
ProcessUtility + 392
20 postgres 0x000000010250e5b4
execute_sql_string + 812
21 postgres 0x000000010250d438
execute_extension_script + 2264
22 postgres 0x000000010250b330
ApplyExtensionUpdates + 1320
23 postgres 0x0000000102507954
CreateExtensionInternal + 1896
24 postgres 0x0000000102506ea4
CreateExtension + 1152
25 postgres 0x00000001028b8ed4
ProcessUtilitySlow + 5032
26 postgres 0x00000001028b600c
standard_ProcessUtility + 3684
27 age.so 0x00000001032844f8
ag_ProcessUtility_hook + 200
28 postgres 0x00000001028b516c
ProcessUtility + 392
29 postgres 0x00000001028b4768
PortalRunUtility + 232
30 postgres 0x00000001028b3660
PortalRunMulti + 756
31 postgres 0x00000001028b2abc
PortalRun + 1008
32 postgres 0x00000001028ad870
exec_simple_query + 1436
33 postgres 0x00000001028ac990
PostgresMain + 2472
34 postgres 0x00000001027a49ac
report_fork_failure_to_client + 0
35 postgres 0x00000001027a3e54
BackendStartup + 520
36 postgres 0x00000001027a29f0
ServerLoop + 812
37 postgres 0x000000010279fe0c
PostmasterMain + 6484
38 postgres 0x000000010266acd0
startup_hacks + 0
39 dyld 0x000000018a3ab154 start +
2476
* Fix CSV import for edge with one property (#2175)
- start_index marks where property fields begin. For edges, it's 4.
If start_index >= total_fields, create empty properties; otherwise,
parse the properties.
---------
Co-authored-by: Umar Hayat <[email protected]>
Co-authored-by: Muhammad Taha Naveed <[email protected]>
Co-authored-by: Andrey Borodin <[email protected]>
Co-authored-by: Moontasir Mahmood <[email protected]>
---
.asf.yaml | 4 ++++
.github/labeler.yml | 8 +++++++-
.github/workflows/installcheck.yaml | 34 +++++++++++++++++-----------------
README.md | 10 +++++-----
docker/Dockerfile | 12 ++++++------
docker/Dockerfile.dev | 4 ++--
src/backend/nodes/ag_nodes.c | 2 +-
src/backend/parser/cypher_analyze.c | 10 ++++++++--
8 files changed, 50 insertions(+), 34 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index 071b3cd6..da422d3b 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -50,6 +50,10 @@ github:
required_pull_request_reviews:
required_approving_review_count: 1
+ PG17:
+ required_pull_request_reviews:
+ required_approving_review_count: 2
+
PG16:
required_pull_request_reviews:
required_approving_review_count: 1
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 92ab6db8..6baa297c 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -13,5 +13,11 @@ PG14:
PG15:
- base-branch: 'PG15'
+PG16:
+- base-branch: 'PG16'
+
+PG17:
+- base-branch: 'PG17'
+
master:
-- base-branch: 'master'
\ No newline at end of file
+- base-branch: 'master'
diff --git a/.github/workflows/installcheck.yaml
b/.github/workflows/installcheck.yaml
index daa58e7f..da266f0d 100644
--- a/.github/workflows/installcheck.yaml
+++ b/.github/workflows/installcheck.yaml
@@ -11,53 +11,53 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Get latest commit id of PostgreSQL 16
+ - name: Get latest commit id of PostgreSQL 17
run: |
- echo "PG_COMMIT_HASH=$(git ls-remote
https://git.postgresql.org/git/postgresql.git refs/heads/REL_16_STABLE | awk
'{print $1}')" >> $GITHUB_ENV
+ echo "PG_COMMIT_HASH=$(git ls-remote
https://git.postgresql.org/git/postgresql.git refs/heads/REL_17_STABLE | awk
'{print $1}')" >> $GITHUB_ENV
- - name: Cache PostgreSQL 16
+ - name: Cache PostgreSQL 17
uses: actions/cache@v3
- id: pg16cache
+ id: pg17cache
with:
- path: ~/pg16
- key: ${{ runner.os }}-v1-pg16-${{ env.PG_COMMIT_HASH }}
+ path: ~/pg17
+ key: ${{ runner.os }}-v1-pg17-${{ env.PG_COMMIT_HASH }}
- name: Install necessary dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev
flex bison
- - name: Install PostgreSQL 16 and some extensions
- if: steps.pg16cache.outputs.cache-hit != 'true'
+ - name: Install PostgreSQL 17 and some extensions
+ if: steps.pg17cache.outputs.cache-hit != 'true'
run: |
- git clone --depth 1 --branch REL_16_STABLE
https://git.postgresql.org/git/postgresql.git ~/pg16source
- cd ~/pg16source
- ./configure --prefix=$HOME/pg16 CFLAGS="-std=gnu99 -ggdb -O0"
--enable-cassert
+ git clone --depth 1 --branch REL_17_STABLE
https://git.postgresql.org/git/postgresql.git ~/pg17source
+ cd ~/pg17source
+ ./configure --prefix=$HOME/pg17 CFLAGS="-std=gnu99 -ggdb -O0"
--enable-cassert
make install -j$(nproc) > /dev/null
cd contrib
cd fuzzystrmatch
- make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc) >
/dev/null
+ make PG_CONFIG=$HOME/pg17/bin/pg_config install -j$(nproc) >
/dev/null
cd ../pg_trgm
- make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc) >
/dev/null
+ make PG_CONFIG=$HOME/pg17/bin/pg_config install -j$(nproc) >
/dev/null
- uses: actions/checkout@v3
- name: Build AGE
id: build
run: |
- make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc)
-
+ make PG_CONFIG=$HOME/pg17/bin/pg_config install -j$(nproc)
+
- name: Pull and build pgvector
id: pgvector
run: |
git clone https://github.com/pgvector/pgvector.git
cd pgvector
- make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc) >
/dev/null
+ make PG_CONFIG=$HOME/pg17/bin/pg_config install -j$(nproc) >
/dev/null
- name: Regression tests
id: regression_tests
run: |
- make PG_CONFIG=$HOME/pg16/bin/pg_config installcheck
EXTRA_TESTS="pgvector fuzzystrmatch pg_trgm"
+ make PG_CONFIG=$HOME/pg17/bin/pg_config installcheck
EXTRA_TESTS="pgvector fuzzystrmatch pg_trgm"
continue-on-error: true
- name: Dump regression test errors
diff --git a/README.md b/README.md
index a89c6f65..613a6643 100644
--- a/README.md
+++ b/README.md
@@ -33,8 +33,8 @@
<img
src="https://img.shields.io/badge/Release-v1.5.0-FFA500?labelColor=gray&style=flat&link=https://github.com/apache/age/releases"/>
</a>
- <a href="https://www.postgresql.org/docs/16/index.html">
- <img src="https://img.shields.io/badge/Version-Postgresql
16-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/16/index.html"/>
+ <a href="https://www.postgresql.org/docs/17/index.html">
+ <img src="https://img.shields.io/badge/Version-Postgresql
17-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/17/index.html"/>
</a>
<a href="https://github.com/apache/age/issues">
@@ -125,7 +125,7 @@ Apache AGE is intended to be simple to install and run. It
can be installed with
Install PostgreSQL
</h4>
-You will need to install an AGE compatible version of Postgres<a>, for now AGE
supports Postgres 11, 12, 13, 14, 15 & 16. Supporting the latest versions is on
AGE roadmap.
+You will need to install an AGE compatible version of Postgres<a>, for now AGE
supports Postgres 11, 12, 13, 14, 15, 16 & 17. Supporting the latest versions
is on AGE roadmap.
<h4>
Installation via Package Manager
@@ -143,7 +143,7 @@ sudo apt install postgresql
Installation From Source Code
</h4>
-You can <a href="https://www.postgresql.org/ftp/source/"> download the
Postgres </a> source code and install your own instance of Postgres. You can
read instructions on how to install from source code for different versions on
the <a href="https://www.postgresql.org/docs/16/installation.html">official
Postgres Website.</a>
+You can <a href="https://www.postgresql.org/ftp/source/"> download the
Postgres </a> source code and install your own instance of Postgres. You can
read instructions on how to install from source code for different versions on
the <a href="https://www.postgresql.org/docs/17/installation.html">official
Postgres Website.</a>
@@ -152,7 +152,7 @@ You can <a href="https://www.postgresql.org/ftp/source/">
download the Postgres
Clone the <a href="https://github.com/apache/age">github repository</a> or
download the <a href="https://github.com/apache/age/releases">download an
official release.
</a>
-Run the pg_config utility and check the version of PostgreSQL. Currently, only
PostgreSQL versions 11, 12, 13, 14, 15 & 16 are supported. If you have any
other version of Postgres, you will need to install PostgreSQL version 11, 12,
13, 14, 15, or 16.
+Run the pg_config utility and check the version of PostgreSQL. Currently, only
PostgreSQL versions 11, 12, 13, 14, 15, 16 & 17 are supported. If you have any
other version of Postgres, you will need to install PostgreSQL version 11, 12,
13, 14, 15, 16 & 17.
<br>
```bash
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 33607058..91c626d6 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -17,14 +17,14 @@
#
# Build stage: Install necessary development tools for compilation and
installation
-FROM postgres:16 AS build
+FROM postgres:17 AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
bison \
build-essential \
flex \
- postgresql-server-dev-16
+ postgresql-server-dev-17
COPY . /age
@@ -34,7 +34,7 @@ RUN make && make install
# Final stage: Create a final image by copying the files created in the build
stage
-FROM postgres:16
+FROM postgres:17
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
@@ -48,9 +48,9 @@ ENV LANG=en_US.UTF-8
ENV LC_COLLATE=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8
-COPY --from=build /usr/lib/postgresql/16/lib/age.so /usr/lib/postgresql/16/lib/
-COPY --from=build /usr/share/postgresql/16/extension/age--1.5.0.sql
/usr/share/postgresql/16/extension/
-COPY --from=build /usr/share/postgresql/16/extension/age.control
/usr/share/postgresql/16/extension/
+COPY --from=build /usr/lib/postgresql/17/lib/age.so /usr/lib/postgresql/17/lib/
+COPY --from=build /usr/share/postgresql/17/extension/age--1.5.0.sql
/usr/share/postgresql/17/extension/
+COPY --from=build /usr/share/postgresql/17/extension/age.control
/usr/share/postgresql/17/extension/
COPY docker/docker-entrypoint-initdb.d/00-create-extension-age.sql
/docker-entrypoint-initdb.d/00-create-extension-age.sql
CMD ["postgres", "-c", "shared_preload_libraries=age"]
diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev
index bdf0c40d..48b2db3e 100644
--- a/docker/Dockerfile.dev
+++ b/docker/Dockerfile.dev
@@ -17,14 +17,14 @@
#
-FROM postgres:16
+FROM postgres:17
RUN apt-get update
RUN apt-get install --assume-yes --no-install-recommends --no-install-suggests
\
bison \
build-essential \
flex \
- postgresql-server-dev-16 \
+ postgresql-server-dev-17 \
locales
ENV LANG=en_US.UTF-8
diff --git a/src/backend/nodes/ag_nodes.c b/src/backend/nodes/ag_nodes.c
index 9cab568d..7aaaecaa 100644
--- a/src/backend/nodes/ag_nodes.c
+++ b/src/backend/nodes/ag_nodes.c
@@ -158,7 +158,7 @@ ExtensibleNode *_new_ag_node(Size size, ag_node_tag tag)
{
ExtensibleNode *n;
- n = (ExtensibleNode *)palloc0fast(size);
+ n = (ExtensibleNode *)palloc0(size);
n->type = T_ExtensibleNode;
n->extnodename = node_names[tag];
diff --git a/src/backend/parser/cypher_analyze.c
b/src/backend/parser/cypher_analyze.c
index d53fba3e..af3e83c8 100644
--- a/src/backend/parser/cypher_analyze.c
+++ b/src/backend/parser/cypher_analyze.c
@@ -168,6 +168,8 @@ static bool convert_cypher_walker(Node *node, ParseState
*pstate)
* OpExpr - expression node for an operator invocation
* Const - constant value or expression node
* BoolExpr - expression node for the basic Boolean operators AND, OR,
NOT
+ * JsonConstructorExpr - wrapper over FuncExpr/Aggref/WindowFunc for
+ * SQL/JSON constructors
*
* These are a special case that needs to be ignored.
*
@@ -175,7 +177,8 @@ static bool convert_cypher_walker(Node *node, ParseState
*pstate)
if (IsA(funcexpr, SQLValueFunction)
|| IsA(funcexpr, CoerceViaIO)
|| IsA(funcexpr, Var) || IsA(funcexpr, OpExpr)
- || IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr))
+ || IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr)
+ || IsA(funcexpr, JsonConstructorExpr))
{
return false;
}
@@ -340,6 +343,8 @@ static bool is_func_cypher(FuncExpr *funcexpr)
* OpExpr - expression node for an operator invocation
* Const - constant value or expression node
* BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
+ * JsonConstructorExpr - wrapper over FuncExpr/Aggref/WindowFunc for
+ * SQL/JSON constructors
*
* These are a special case that needs to be ignored.
*
@@ -347,7 +352,8 @@ static bool is_func_cypher(FuncExpr *funcexpr)
if (IsA(funcexpr, SQLValueFunction)
|| IsA(funcexpr, CoerceViaIO)
|| IsA(funcexpr, Var) || IsA(funcexpr, OpExpr)
- || IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr))
+ || IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr)
+ || IsA(funcexpr, JsonConstructorExpr))
{
return false;
}