lolor

Logical-replication-friendly replacement for PostgreSQL large objects

Overview

PackageVersionCategoryLicenseLanguage
lolor1.2.2ETLPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
9580lolorNoYesNoYesYesNololor
Relatedspock snowflake

works on pgedge kernel fork. Requires lolor.node

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.2.21817161514lolor-
RPMPIGSTY18.41817161514pgedge-$v-
DEBPIGSTY18.41817161514pgedge-$v-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64N/A
el8.aarch64N/A
el9.x86_64N/A
el9.aarch64N/A
el10.x86_64N/A
el10.aarch64N/A
d12.x86_64N/A
d12.aarch64N/A
d13.x86_64N/A
d13.aarch64N/A
u22.x86_64N/A
u22.aarch64N/A
u24.x86_64N/A
u24.aarch64N/A
u26.x86_64N/A
u26.aarch64N/A

Build

You can build the RPM / DEB packages for lolor using pig build:

pig build pkg lolor         # build RPM / DEB packages

Install

You can install lolor 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 lolor;          # Install for current active PG version
pig ext install -y lolor -v 18  # PG 18
pig ext install -y lolor -v 17  # PG 17
pig ext install -y lolor -v 16  # PG 16
pig ext install -y lolor -v 15  # PG 15
dnf install -y pgedge-18       # PG 18
dnf install -y pgedge-17       # PG 17
dnf install -y pgedge-16       # PG 16
dnf install -y pgedge-15       # PG 15
apt install -y pgedge-18   # PG 18
apt install -y pgedge-17   # PG 17
apt install -y pgedge-16   # PG 16
apt install -y pgedge-15   # PG 15

Create Extension:

CREATE EXTENSION lolor;

Usage

lolor: Logical-replication-friendly replacement for PostgreSQL large objects

Makes PostgreSQL large objects compatible with logical replication by storing them in non-catalog tables.

Enabling

CREATE EXTENSION lolor;

Configure the node identifier in postgresql.conf:

lolor.node = 1  -- unique node ID (1 to 2^28)

Optionally adjust the search path:

SET search_path = lolor, "$user", public, pg_catalog;

Large Object Operations

Once installed, the standard lo_* functions are redirected to use lolor’s tables:

-- Create a large object
SELECT lo_create(0);

-- Import a file into a large object
SELECT lo_import('/path/to/file.bin');

-- Export a large object to a file
SELECT lo_export(oid, '/path/to/output.bin');

-- Open, read, write, seek, close
SELECT lo_open(oid, x'40000'::int);  -- INV_WRITE
SELECT lowrite(fd, 'data'::bytea);
SELECT loread(fd, 1024);
SELECT lo_close(fd);

-- Delete a large object
SELECT lo_unlink(oid);

Replication Setup

Add lolor tables to your replication set:

-- For spock/pgedge replication
SELECT spock.repset_add_table('default', 'lolor.pg_largeobject');
SELECT spock.repset_add_table('default', 'lolor.pg_largeobject_metadata');

Internal Tables

The extension manages large objects in:

  • lolor.pg_largeobject - stores object data chunks
  • lolor.pg_largeobject_metadata - stores object metadata

Limitations

  • Native PostgreSQL large object functionality cannot be used while lolor is active
  • Migration of existing native large objects to lolor is not supported
  • ALTER LARGE OBJECT, GRANT ON LARGE OBJECT, COMMENT ON LARGE OBJECT, and REVOKE ON LARGE OBJECT are not supported
  • Requires PostgreSQL 16 or newer

Last Modified 2026-07-23: update extension list to 555 (d81fc56)