Skip to content

age

age : AGE graph database extension

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2600
age
age
1.7.0
FEAT
Apache-2.0
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd--
No
Yes
Yes
Yes
no
no
Relationships
Schemasag_catalog
See Also
pg_graphql
rum
pg_jsonschema
jsquery
ltree
http
pg_net
citus

pg18/17 = 1.7.0, pg 14-17 with 1.6.0 support, rename apache_age to age on el since 1.7

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
1.7.0
18
17
16
15
14
age-
RPM
PIGSTY
1.7.0
18
17
16
15
14
age_$v-
DEB
PIGSTY
1.7.0
18
17
16
15
14
postgresql-$v-age-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.6.0
PIGSTY 1.6.0
PIGSTY 1.6.0
el8.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.6.0
PIGSTY 1.6.0
PIGSTY 1.6.0
el9.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.6.0
PIGSTY 1.6.0
PIGSTY 1.6.0
el9.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.6.0
PIGSTY 1.6.0
PIGSTY 1.6.0
el10.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.6.0
PIGSTY 1.6.0
PIGSTY 1.6.0
el10.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.6.0
PIGSTY 1.6.0
PIGSTY 1.6.0
d12.x86_64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
d12.aarch64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
d13.x86_64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
d13.aarch64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
u22.x86_64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
u22.aarch64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
u24.x86_64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
u24.aarch64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
u26.x86_64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
u26.aarch64
PGDG 1.8.0
PIGSTY 1.7.0
PGDG 1.6.0
PGDG 1.6.0
PGDG 1.6.0
PackageVersionOSORGSIZEFile URL
age_181.7.0el8.x86_64pigsty247.6 KiBage_18-1.7.0-2PIGSTY.el8.x86_64.rpm
age_181.7.0el8.x86_64pgdg227.0 KiBage_18-1.7.0-rc0_1PGDG.rhel8.10.x86_64.rpm
age_181.7.0el8.aarch64pigsty229.8 KiBage_18-1.7.0-2PIGSTY.el8.aarch64.rpm
age_181.7.0el8.aarch64pgdg209.6 KiBage_18-1.7.0-rc0_1PGDG.rhel8.10.aarch64.rpm
age_181.7.0el9.x86_64pigsty229.2 KiBage_18-1.7.0-2PIGSTY.el9.x86_64.rpm
age_181.7.0el9.x86_64pgdg225.4 KiBage_18-1.7.0-rc0_1PGDG.rhel9.8.x86_64.rpm
age_181.7.0el9.x86_64pgdg225.4 KiBage_18-1.7.0-rc0_1PGDG.rhel9.7.x86_64.rpm
age_181.7.0el9.x86_64pgdg225.5 KiBage_18-1.7.0-rc0_1PGDG.rhel9.6.x86_64.rpm
age_181.7.0el9.aarch64pigsty221.0 KiBage_18-1.7.0-2PIGSTY.el9.aarch64.rpm
age_181.7.0el9.aarch64pgdg216.0 KiBage_18-1.7.0-rc0_1PGDG.rhel9.8.aarch64.rpm
age_181.7.0el9.aarch64pgdg216.0 KiBage_18-1.7.0-rc0_1PGDG.rhel9.7.aarch64.rpm
age_181.7.0el9.aarch64pgdg216.2 KiBage_18-1.7.0-rc0_1PGDG.rhel9.6.aarch64.rpm
age_181.7.0el10.x86_64pigsty231.5 KiBage_18-1.7.0-2PIGSTY.el10.x86_64.rpm
age_181.7.0el10.x86_64pgdg227.9 KiBage_18-1.7.0-rc0_1PGDG.rhel10.2.x86_64.rpm
age_181.7.0el10.x86_64pgdg227.9 KiBage_18-1.7.0-rc0_1PGDG.rhel10.1.x86_64.rpm
age_181.7.0el10.x86_64pgdg228.2 KiBage_18-1.7.0-rc0_1PGDG.rhel10.0.x86_64.rpm
age_181.7.0el10.aarch64pigsty221.8 KiBage_18-1.7.0-2PIGSTY.el10.aarch64.rpm
age_181.7.0el10.aarch64pgdg218.2 KiBage_18-1.7.0-rc0_1PGDG.rhel10.2.aarch64.rpm
age_181.7.0el10.aarch64pgdg218.3 KiBage_18-1.7.0-rc0_1PGDG.rhel10.1.aarch64.rpm
age_181.7.0el10.aarch64pgdg218.3 KiBage_18-1.7.0-rc0_1PGDG.rhel10.0.aarch64.rpm
postgresql-18-age1.8.0d12.x86_64pgdg798.0 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg12+1_amd64.deb
postgresql-18-age1.7.0d12.x86_64pigsty682.6 KiBpostgresql-18-age_1.7.0-2PIGSTY~bookworm_amd64.deb
postgresql-18-age1.7.0d12.x86_64pgdg680.5 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg12+1_amd64.deb
postgresql-18-age1.8.0d12.aarch64pgdg773.3 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg12+1_arm64.deb
postgresql-18-age1.7.0d12.aarch64pigsty661.9 KiBpostgresql-18-age_1.7.0-2PIGSTY~bookworm_arm64.deb
postgresql-18-age1.7.0d12.aarch64pgdg661.4 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg12+1_arm64.deb
postgresql-18-age1.8.0d13.x86_64pgdg796.2 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg13+1_amd64.deb
postgresql-18-age1.7.0d13.x86_64pigsty683.5 KiBpostgresql-18-age_1.7.0-2PIGSTY~trixie_amd64.deb
postgresql-18-age1.7.0d13.x86_64pgdg682.3 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg13+1_amd64.deb
postgresql-18-age1.8.0d13.aarch64pgdg773.7 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg13+1_arm64.deb
postgresql-18-age1.7.0d13.aarch64pigsty664.6 KiBpostgresql-18-age_1.7.0-2PIGSTY~trixie_arm64.deb
postgresql-18-age1.7.0d13.aarch64pgdg662.7 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg13+1_arm64.deb
postgresql-18-age1.8.0u22.x86_64pgdg828.3 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg22.04+1_amd64.deb
postgresql-18-age1.7.0u22.x86_64pigsty764.5 KiBpostgresql-18-age_1.7.0-2PIGSTY~jammy_amd64.deb
postgresql-18-age1.7.0u22.x86_64pgdg702.8 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg22.04+1_amd64.deb
postgresql-18-age1.8.0u22.aarch64pgdg803.5 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg22.04+1_arm64.deb
postgresql-18-age1.7.0u22.aarch64pigsty753.4 KiBpostgresql-18-age_1.7.0-2PIGSTY~jammy_arm64.deb
postgresql-18-age1.7.0u22.aarch64pgdg682.6 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg22.04+1_arm64.deb
postgresql-18-age1.8.0u24.x86_64pgdg795.4 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg24.04+1_amd64.deb
postgresql-18-age1.7.0u24.x86_64pigsty729.0 KiBpostgresql-18-age_1.7.0-2PIGSTY~noble_amd64.deb
postgresql-18-age1.7.0u24.x86_64pgdg681.4 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg24.04+1_amd64.deb
postgresql-18-age1.8.0u24.aarch64pgdg772.5 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg24.04+1_arm64.deb
postgresql-18-age1.7.0u24.aarch64pigsty717.0 KiBpostgresql-18-age_1.7.0-2PIGSTY~noble_arm64.deb
postgresql-18-age1.7.0u24.aarch64pgdg660.4 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg24.04+1_arm64.deb
postgresql-18-age1.8.0u26.x86_64pgdg795.1 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg26.04+1_amd64.deb
postgresql-18-age1.7.0u26.x86_64pigsty722.3 KiBpostgresql-18-age_1.7.0-2PIGSTY~resolute_amd64.deb
postgresql-18-age1.7.0u26.x86_64pgdg680.4 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg26.04+1_amd64.deb
postgresql-18-age1.8.0u26.aarch64pgdg771.3 KiBpostgresql-18-age_1.8.0~rc0-2.pgdg26.04+1_arm64.deb
postgresql-18-age1.7.0u26.aarch64pigsty710.1 KiBpostgresql-18-age_1.7.0-2PIGSTY~resolute_arm64.deb
postgresql-18-age1.7.0u26.aarch64pgdg656.3 KiBpostgresql-18-age_1.7.0~rc0-1.pgdg26.04+1_arm64.deb

Source

pig build pkg age;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install age;		# install via package name, for the active PG version

pig install age -v 18;   # install for PG 18
pig install age -v 17;   # install for PG 17

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'age';

Create this extension with:

CREATE EXTENSION age;

Usage

Sources: Apache AGE repository, PG17 v1.7.0 branch, PG18 v1.7.0 branch

Apache AGE brings graph database capabilities to PostgreSQL using the openCypher query language. It enables hybrid querying that combines SQL and Cypher, property indexes on vertices and edges, and the ability to query multiple graphs.

Each session requires loading the extension:

CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;

Graph Operations

Create a graph:

SELECT create_graph('my_graph');

Create vertices:

SELECT * FROM cypher('my_graph', $$
    CREATE (:Person {name: 'Alice', age: 30})
$$) AS (v agtype);

SELECT * FROM cypher('my_graph', $$
    CREATE (:Person {name: 'Bob', age: 25})
$$) AS (v agtype);

Create edges:

SELECT * FROM cypher('my_graph', $$
    MATCH (a:Person), (b:Person)
    WHERE a.name = 'Alice' AND b.name = 'Bob'
    CREATE (a)-[e:KNOWS {since: 2020}]->(b)
    RETURN e
$$) AS (e agtype);

Query the graph:

SELECT * FROM cypher('my_graph', $$
    MATCH (v)-[r]-(v2)
    RETURN v, r, v2
$$) AS (v agtype, r agtype, v2 agtype);

Cypher Query Features

AGE supports standard Cypher clauses including MATCH, CREATE, SET, DELETE, RETURN, WITH, WHERE, ORDER BY, SKIP, and LIMIT. Data is stored using the agtype data type, which extends JSON with graph-specific types for vertices, edges, and paths.

Pattern matching with variable-length paths:

SELECT * FROM cypher('my_graph', $$
    MATCH (a:Person)-[:KNOWS*1..3]->(b:Person)
    RETURN a.name, b.name
$$) AS (source agtype, target agtype);

Hybrid SQL/Cypher queries allow joining graph results with relational tables:

SELECT t.*, c.* FROM my_table t
JOIN cypher('my_graph', $$
    MATCH (n:Person) RETURN n.name, id(n)
$$) AS c(name agtype, id agtype)
ON t.graph_id = c.id;

Version Notes

Apache AGE 1.7.0 is published through PostgreSQL-major-specific branches for PostgreSQL 17 and 18. The README surface remains the same graph/Cypher workflow, with support focused on the newer PostgreSQL majors rather than PG14-16.

Last updated on