Skip to content
lolor

lolor

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

Overview

ID Extension Package Version Category License Language
9580
lolor
lolor
1.2.2
ETL
PostgreSQL
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-dt-
No
Yes
No
Yes
no
yes
Relationships
Schemas lolor
See Also
lo
pglogical
spock
mimeo
pgl_ddl_deploy
logical_ddl
pg_surgery
pg_repack

works on pgedge kernel fork. Requires lolor.node

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.2.2
18
17
16
15
14
lolor -
RPM
PIGSTY
18.4
18
17
16
15
14
pgedge-$v -
DEB
PIGSTY
18.4
18
17
16
15
14
pgedge-$v -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
el8.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
el9.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
el9.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
el10.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
el10.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
d12.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
d12.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
d13.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
d13.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
u22.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
u22.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
u24.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
u24.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
u26.x86_64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
u26.aarch64
PIGSTY 18.4
PIGSTY 17.10
PIGSTY 16.14
PIGSTY 15.18
N/A
Package Version OS ORG SIZE File URL
pgedge-18 18.4 el8.x86_64 pigsty 13.2 MiB pgedge-18-18.4-1PIGSTY.el8.x86_64.rpm
pgedge-18 18.4 el8.aarch64 pigsty 12.8 MiB pgedge-18-18.4-1PIGSTY.el8.aarch64.rpm
pgedge-18 18.4 el9.x86_64 pigsty 12.1 MiB pgedge-18-18.4-1PIGSTY.el9.x86_64.rpm
pgedge-18 18.4 el9.aarch64 pigsty 11.8 MiB pgedge-18-18.4-1PIGSTY.el9.aarch64.rpm
pgedge-18 18.4 el10.x86_64 pigsty 12.2 MiB pgedge-18-18.4-1PIGSTY.el10.x86_64.rpm
pgedge-18 18.4 el10.aarch64 pigsty 12.0 MiB pgedge-18-18.4-1PIGSTY.el10.aarch64.rpm
pgedge-18 18.4 d12.x86_64 pigsty 10.5 MiB pgedge-18_18.4-1PIGSTY~bookworm_amd64.deb
pgedge-18 18.4 d12.aarch64 pigsty 10.0 MiB pgedge-18_18.4-1PIGSTY~bookworm_arm64.deb
pgedge-18 18.4 d13.x86_64 pigsty 10.5 MiB pgedge-18_18.4-1PIGSTY~trixie_amd64.deb
pgedge-18 18.4 d13.aarch64 pigsty 10.1 MiB pgedge-18_18.4-1PIGSTY~trixie_arm64.deb
pgedge-18 18.4 u22.x86_64 pigsty 11.9 MiB pgedge-18_18.4-1PIGSTY~jammy_amd64.deb
pgedge-18 18.4 u22.aarch64 pigsty 11.7 MiB pgedge-18_18.4-1PIGSTY~jammy_arm64.deb
pgedge-18 18.4 u24.x86_64 pigsty 11.7 MiB pgedge-18_18.4-1PIGSTY~noble_amd64.deb
pgedge-18 18.4 u24.aarch64 pigsty 11.6 MiB pgedge-18_18.4-1PIGSTY~noble_arm64.deb
pgedge-18 18.4 u26.x86_64 pigsty 11.8 MiB pgedge-18_18.4-1PIGSTY~resolute_amd64.deb
pgedge-18 18.4 u26.aarch64 pigsty 11.5 MiB pgedge-18_18.4-1PIGSTY~resolute_arm64.deb

Source

pig build pkg lolor;		# 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 lolor;		# install via package name, for the active PG version

pig install lolor -v 18;   # install for PG 18
pig install lolor -v 17;   # install for PG 17
pig install lolor -v 16;   # install for PG 16
pig install lolor -v 15;   # install for PG 15

Create this extension with:

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 updated on