DEV Community

Mohamed Mokhtar
Mohamed Mokhtar

Posted on • Updated on

Guide to Apache AGE 1.3.0 Release for PostgreSQL 13

Introduction

Apache AGE is an open-source extension for PostgreSQL database management system. It is the world's first graph database extension that runs inside a traditional relational database system, bringing together the power and versatility of graph databases with the reliability and scalability of PostgreSQL.

Recently, Apache AGE has released its latest version 1.3.0, which comes with lots of new features, performance improvements, and bug fixes. In this guide, we'll take a closer look at the new features of Apache AGE 1.3.0 release for PostgreSQL 13.

Requirements

Note: If you have not already installed AGE/POSTGRESQL stack on your machine, you will need to do the same procedure with Postgrsql 11 and AGE 1.1.0 latest release to compare the previous and new changes :)

[DISCUSS] Apache AGE 1.3.0 Release for PostgreSQL 13 said:

NOTE: Due to this being the first release for PostgreSQL 13, there is no
upgrade path from other versions.
Enter fullscreen mode Exit fullscreen mode

Which means we will have only single sql script named age--1.3.0.sql

Setup

PostgreSQL 13 and AGE 1.3.0

Lets create a directory called bitnine and having our testing and reporting inside

mkdir bitnine
Enter fullscreen mode Exit fullscreen mode

Lets start with PostgreSQL 13 installation in a custom path
Reference: https://www.postgresql.org/docs/13/install-short.html

  1. Download the source code from https://www.postgresql.org/ftp/source/v13.0/
  2. Move the download file to bitnine and extract the source code into
  3. Follow the following commands
# move the source code to our new created directory
mv ~/Downloads/postgresql-13.0.tar.gz ~/bitnie/
# change directory to bitnine 
cd ~/bitnine
# extract the source code
tar xzf postgresql-13.0.tar.gz
# make directory for having the build of the postgres
mkdir pg13
# make directory for holding the data
mkdir pg13data
# go to postgresql-13.0
cd postgresql-13.0
# configure the source code build
./configure --prefix=/home/rrr/bitnine/pg13 --enable-debug --with-pgport=5431
make
sudo make install
# ensure installation
cd ..
cd pg13
# expected dirs: bin  include  lib  share
ls
# add new user or just skip it and use your preferred 
adduser postgres
# change ownership to the user
chown postgres pg13data
# switch to the user
su - postgres
# Update LD_LIBRARY_PATH (very important step)
LD_LIBRARY_PATH=/home/rrr/bitnine/pg13/lib
export LD_LIBRARY_PATH
# init db cluster
./pg13/bin/initdb -D ./pg13data
# start the server
./pg13/bin/postgres -D ./pg13data/ -p 5431 >logfile 2>&1 &
# create database 'test' 
./pg13/bin/createdb test -p 5431
# start postgresql session
# output psql (13.0)
./pg13/bin/psql test
\q
Enter fullscreen mode Exit fullscreen mode

Lets then install AGE 1.3.0
Apache AGE 1.3.0 for PostgreSQL 13 Release Notes

The target link we will have AGE 1.3.0 from is the release from their repository: AGE-1.3.0

  1. Download source code https://github.com/apache/age/releases/tag/PG13/v1.3.0-rc0
  2. Move it to bitnine
mv ~/Downloads/apache-age-1.3.0-src.tar.gz ~/bitnine/
tar xzf apache-age-1.3.0-src.tar.gz
cd apache-age-1.3.0
# If you opened a new terminal / you have not set it automatically
LD_LIBRARY_PATH=/home/rrr/bitnine/pg13/lib
export LD_LIBRARY_PATH
# install
sudo make PG_CONFIG=/home/rrr/bitnine/pg13/bin/pg_config install
# installcheck
sudo make clean
make PG_CONFIG=/home/rrr/bitnine/pg13/bin/pg_config installcheck
./pg13/bin/psql test
CREATE EXTENSION age;
LOAD 'age';
SELECT * FROM ag_catalog.create_graph('test_graph');
Enter fullscreen mode Exit fullscreen mode

Reporting:

  1. All tests passes 24/24

2.Tested the implementation of CALL ...[YIELD] for cypher functions. (#630 https://github.com/apache/age/pull/630)

  1. I see that feature already implemented and mentioned on AGE 1.2.0 and it works properly there I think there is no point to get it mentioned in the new version as well Graph names with the empty string '' are no more allowed. (#251)

  2. Reviewed the typo changes

  3. Reviewed the regressions tests

  4. Signature Check => check and pass

  5. License and Notice => check and pass

  6. No binary files => check and pass

  7. Graph names with the empty string '' are no more allowed. (#251) : I see that feature already
    implemented and mentioned on AGE 1.2.0 and it works properly there. I think there is no point in getting
    it mentioned in the new version as well. If the comparison between AGE 1.3.0 and 1.1.0 then it's okay.

  8. At drop_graph with ‘’ empty string it outputs graph "" does not exist while name is not valid should
    both are valid but for consistency I think it may be similar the the create_graph output.

  9. Running a session with multiple queries contains the age clauses.

  10. Tested queries contains multiple data types returning queries.

Feedback

I liked the upgrade overall because it will be necessary to be adaptable with all and most recent PG’s
versions so it is a great effort and work, well done.

References and resources

Changes log

  • Implement CALL ...[YIELD] for cypher functions. (#630)
  • Graph names with the empty string '' are no more allowed. (#251)
  • Fix typos at multiple locations. (#470)
  • Fix Bug with CALL... [YIELD], clause ignores WHERE.
  • Fix EXPLAIN to allow for nested cypher commands.
  • Fix delete_global_graphs and add regression tests. (#336)
  • Invalid labels now return NULL.
  • Update CONTRIBUTING.md (#348)
  • Fix null pointer on name compare. (#376)
  • Fix Travis CI warning messages.
  • Additional regression tests added for age_global_graph. (#341)
  • Readme Added for AGE-JDBC-Driver. (#383)
  • Updated volitility categories for many functions.
  • Fix issue 339 - entities in WHERE clause have wrong Expr. (#391)
  • Create complete graph function. (#342) (#662)
  • Fix issue 317: Graph naming convention. (#349)
  • Update SET clause to support assigning a map to a variable. (#468)
  • Patch to address PR 203 that appears to be inactive. (#671)
  • Add additional comments for create_graph function. (#582)
  • Optimize age_exists function. (#586)
  • Implement plus-equal operator in SET clause. (#638)
  • Implement CI test for python driver. (#587)
  • Move from travis CI to github actions for build. (#673)
  • Update all driver CIs to Github actions.
  • Fix build warnings. (#709)
  • Updated Readme for drivers folder. (#642)
  • Removed async from function definitions. (#680)
  • Barbell graph generation (#648) and Barbell regress tests. (#708)
  • UPDATED Python Driver ANTLR 4.9.3 -> 4.11.1 (#706)
  • Fix WITH ignoring WHERE clause. (#646)
  • Implement isEmpty() predicate function. (#710)
  • Fix cypher function input argument checks. (#718)
  • Fix Issue 693 - server termination from return exists(path). (#721)
  • Update regression tests for cypher_with. (#725)
  • Fix issue 733 - create_complete_graph() terminates the server. (#734)
  • Prevent MATCH from following OPTIONAL MATCH. (#740)
  • Fix property constraints against resolved variables. (#724) (#751) (#701) (#747)
  • Include invalid labels in reused variables. (#751) (#762)
  • Fix update_entity_tuple to use correct CommandId. (#769)
  • Remove check for scalar agtypes in unwind. (#736)
  • Update PG13 CI workflows. (#775)
  • Update readme and version for python driver. (#780)
  • Update README.md

References and resources

Top comments (0)