pg_liquid
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_liquid | 0.1.7 | FEAT | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2705 | pg_liquid | No | Yes | No | Yes | No | No | liquid |
| Related | age jsquery pg_jsonschema pg_search |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.7 | 1817161514 | pg_liquid | - |
| RPM | PIGSTY | 0.1.7 | 1817161514 | pg_liquid_$v | - |
| DEB | PIGSTY | 0.1.7 | 1817161514 | postgresql-$v-pg-liquid | - |
Build
You can build the RPM / DEB packages for pg_liquid using pig build:
pig build pkg pg_liquid # build RPM / DEB packages
Install
You can install pg_liquid directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_liquid; # Install for current active PG version
pig ext install -y pg_liquid -v 18 # PG 18
pig ext install -y pg_liquid -v 17 # PG 17
pig ext install -y pg_liquid -v 16 # PG 16
pig ext install -y pg_liquid -v 15 # PG 15
pig ext install -y pg_liquid -v 14 # PG 14
dnf install -y pg_liquid_18 # PG 18
dnf install -y pg_liquid_17 # PG 17
dnf install -y pg_liquid_16 # PG 16
dnf install -y pg_liquid_15 # PG 15
dnf install -y pg_liquid_14 # PG 14
apt install -y postgresql-18-pg-liquid # PG 18
apt install -y postgresql-17-pg-liquid # PG 17
apt install -y postgresql-16-pg-liquid # PG 16
apt install -y postgresql-15-pg-liquid # PG 15
apt install -y postgresql-14-pg-liquid # PG 14
Create Extension:
CREATE EXTENSION pg_liquid;
Usage
Syntax:
CREATE EXTENSION pg_liquid; SELECT liquid.query('Edge("a","b"). Edge("b","c"). Path(X,Y) :- Edge(X,Y). Path(X,Y) :- Edge(X,Z), Path(Z,Y). Path("a",Y)?');
pg_liquid maps the Liquid blog language and data model onto native PostgreSQL storage and execution. The extension exposes SQL entry points for running Liquid-style programs, querying as a principal, and managing row normalizers that project relational rows into Liquid compounds.
Core Functions
The upstream README lists these main functions:
liquid.query(program text)liquid.query_as(principal text, program text)liquid.read_as(principal text, program text)
These support plain execution, principal-aware querying, and CLS-aware reads.
Language Features
The current README says supported program features include:
%comments- assertions and rule definitions terminated with
. - one terminal
?query Edge(...)- named compounds such as
Type@(cid=..., role=...) - query-local recursive rules
Example Shape
Programs are passed as text and can define facts, rules, and a final query:
SELECT liquid.query($$
Edge("a","b").
Edge("b","c").
Path(X,Y) :- Edge(X,Y).
Path(X,Y) :- Edge(X,Z), Path(Z,Y).
Path("a",Y)?
$$);
Notes
The project README points to the VitePress documentation site as the main documentation surface and notes that operational rollout details are also documented there. The extension is currently published as PGXN package version 0.1.1 and validated against PostgreSQL 14 through 18.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.