Example - Integration with Postgres - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

Postgres supports pglz compression by default. It can be configured and built to use lz4 and zlib compression as well. lz4 and zlib are supported by AOCL-Compression library. Steps to integrate AOCL-Compression with Postgres (using lz4 compression) at compile time and launch it on Linux:

# Configure and build postgresql
cd postgresql-16.2
mkdir build
cd build
../configure --without-zlib --with-lz4 --prefix=$PWD/POSTGRESQL_Binaries LZ4_LIBS="-Llib/directory/path/of/AOCL-Compression" LZ4_CFLAGS="-include/directory/path/of/AOCL-Compression"
make -j;make install
# Setup data folder where you want to have postgresql-data
initdb -D <path-to-data-folder>
# Load AOCL-Compression library and launch postgresql server
export LD_LIBRARY_PATH="lib/directory/path/of/AOCL-Compression":$LD_LIBRARY_PATH
pg_ctl -D <path-to-data-folder> start