跳转到主要内容

lolor

Logical-replication-friendly replacement for PostgreSQL large objects

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.6 18 17 16 15 14 pgedge-$v -
DEB PIGSTY 18.6 18 17 16 15 14 pgedge-$v -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
el8.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
el9.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
el9.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
el10.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
el10.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
d12.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
d12.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
d13.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
d13.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
u22.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
u22.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
u24.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
u24.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
u26.x86_64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
u26.aarch64 PIGSTY 18.6 PIGSTY 17.11 PIGSTY 16.15 PIGSTY 15.19 N/A
Package Version OS ORG SIZE File URL
pgedge-18 18.6 el8.x86_64 pigsty 12.6 MiB pgedge-18-18.6-2PGSTY.el8.x86_64.rpm
pgedge-18 18.6 el8.aarch64 pigsty 12.2 MiB pgedge-18-18.6-2PGSTY.el8.aarch64.rpm
pgedge-18 18.6 el9.x86_64 pigsty 12.0 MiB pgedge-18-18.6-2PGSTY.el9.x86_64.rpm
pgedge-18 18.6 el9.aarch64 pigsty 11.7 MiB pgedge-18-18.6-2PGSTY.el9.aarch64.rpm
pgedge-18 18.6 el10.x86_64 pigsty 12.1 MiB pgedge-18-18.6-2PGSTY.el10.x86_64.rpm
pgedge-18 18.6 el10.aarch64 pigsty 11.9 MiB pgedge-18-18.6-2PGSTY.el10.aarch64.rpm
pgedge-18 18.6 d12.x86_64 pigsty 10.3 MiB pgedge-18_18.6-2PGSTY~bookworm_amd64.deb
pgedge-18 18.6 d12.aarch64 pigsty 9.7 MiB pgedge-18_18.6-2PGSTY~bookworm_arm64.deb
pgedge-18 18.6 d13.x86_64 pigsty 10.3 MiB pgedge-18_18.6-2PGSTY~trixie_amd64.deb
pgedge-18 18.6 d13.aarch64 pigsty 9.8 MiB pgedge-18_18.6-2PGSTY~trixie_arm64.deb
pgedge-18 18.6 u22.x86_64 pigsty 11.6 MiB pgedge-18_18.6-2PGSTY~jammy_amd64.deb
pgedge-18 18.6 u22.aarch64 pigsty 11.4 MiB pgedge-18_18.6-2PGSTY~jammy_arm64.deb
pgedge-18 18.6 u24.x86_64 pigsty 11.4 MiB pgedge-18_18.6-2PGSTY~noble_amd64.deb
pgedge-18 18.6 u24.aarch64 pigsty 11.3 MiB pgedge-18_18.6-2PGSTY~noble_arm64.deb
pgedge-18 18.6 u26.x86_64 pigsty 11.5 MiB pgedge-18_18.6-2PGSTY~resolute_amd64.deb
pgedge-18 18.6 u26.aarch64 pigsty 11.3 MiB pgedge-18_18.6-2PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgedge-17 17.11 el8.x86_64 pigsty 12.2 MiB pgedge-17-17.11-2PGSTY.el8.x86_64.rpm
pgedge-17 17.11 el8.aarch64 pigsty 11.8 MiB pgedge-17-17.11-2PGSTY.el8.aarch64.rpm
pgedge-17 17.11 el9.x86_64 pigsty 11.7 MiB pgedge-17-17.11-2PGSTY.el9.x86_64.rpm
pgedge-17 17.11 el9.aarch64 pigsty 11.5 MiB pgedge-17-17.11-2PGSTY.el9.aarch64.rpm
pgedge-17 17.11 el10.x86_64 pigsty 11.8 MiB pgedge-17-17.11-2PGSTY.el10.x86_64.rpm
pgedge-17 17.11 el10.aarch64 pigsty 11.6 MiB pgedge-17-17.11-2PGSTY.el10.aarch64.rpm
pgedge-17 17.11 d12.x86_64 pigsty 10.0 MiB pgedge-17_17.11-2PGSTY~bookworm_amd64.deb
pgedge-17 17.11 d12.aarch64 pigsty 9.5 MiB pgedge-17_17.11-2PGSTY~bookworm_arm64.deb
pgedge-17 17.11 d13.x86_64 pigsty 10.0 MiB pgedge-17_17.11-2PGSTY~trixie_amd64.deb
pgedge-17 17.11 d13.aarch64 pigsty 9.5 MiB pgedge-17_17.11-2PGSTY~trixie_arm64.deb
pgedge-17 17.11 u22.x86_64 pigsty 11.3 MiB pgedge-17_17.11-2PGSTY~jammy_amd64.deb
pgedge-17 17.11 u22.aarch64 pigsty 11.1 MiB pgedge-17_17.11-2PGSTY~jammy_arm64.deb
pgedge-17 17.11 u24.x86_64 pigsty 11.2 MiB pgedge-17_17.11-2PGSTY~noble_amd64.deb
pgedge-17 17.11 u24.aarch64 pigsty 11.0 MiB pgedge-17_17.11-2PGSTY~noble_arm64.deb
pgedge-17 17.11 u26.x86_64 pigsty 11.2 MiB pgedge-17_17.11-2PGSTY~resolute_amd64.deb
pgedge-17 17.11 u26.aarch64 pigsty 10.9 MiB pgedge-17_17.11-2PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgedge-16 16.15 el8.x86_64 pigsty 11.5 MiB pgedge-16-16.15-2PGSTY.el8.x86_64.rpm
pgedge-16 16.15 el8.aarch64 pigsty 11.1 MiB pgedge-16-16.15-2PGSTY.el8.aarch64.rpm
pgedge-16 16.15 el9.x86_64 pigsty 11.2 MiB pgedge-16-16.15-2PGSTY.el9.x86_64.rpm
pgedge-16 16.15 el9.aarch64 pigsty 10.9 MiB pgedge-16-16.15-2PGSTY.el9.aarch64.rpm
pgedge-16 16.15 el10.x86_64 pigsty 11.3 MiB pgedge-16-16.15-2PGSTY.el10.x86_64.rpm
pgedge-16 16.15 el10.aarch64 pigsty 11.1 MiB pgedge-16-16.15-2PGSTY.el10.aarch64.rpm
pgedge-16 16.15 d12.x86_64 pigsty 9.5 MiB pgedge-16_16.15-2PGSTY~bookworm_amd64.deb
pgedge-16 16.15 d12.aarch64 pigsty 9.0 MiB pgedge-16_16.15-2PGSTY~bookworm_arm64.deb
pgedge-16 16.15 d13.x86_64 pigsty 9.5 MiB pgedge-16_16.15-2PGSTY~trixie_amd64.deb
pgedge-16 16.15 d13.aarch64 pigsty 9.1 MiB pgedge-16_16.15-2PGSTY~trixie_arm64.deb
pgedge-16 16.15 u22.x86_64 pigsty 10.8 MiB pgedge-16_16.15-2PGSTY~jammy_amd64.deb
pgedge-16 16.15 u22.aarch64 pigsty 10.6 MiB pgedge-16_16.15-2PGSTY~jammy_arm64.deb
pgedge-16 16.15 u24.x86_64 pigsty 10.7 MiB pgedge-16_16.15-2PGSTY~noble_amd64.deb
pgedge-16 16.15 u24.aarch64 pigsty 10.5 MiB pgedge-16_16.15-2PGSTY~noble_arm64.deb
pgedge-16 16.15 u26.x86_64 pigsty 10.7 MiB pgedge-16_16.15-2PGSTY~resolute_amd64.deb
pgedge-16 16.15 u26.aarch64 pigsty 10.4 MiB pgedge-16_16.15-2PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgedge-15 15.19 el8.x86_64 pigsty 10.3 MiB pgedge-15-15.19-2PGSTY.el8.x86_64.rpm
pgedge-15 15.19 el8.aarch64 pigsty 9.9 MiB pgedge-15-15.19-2PGSTY.el8.aarch64.rpm
pgedge-15 15.19 el9.x86_64 pigsty 10.2 MiB pgedge-15-15.19-2PGSTY.el9.x86_64.rpm
pgedge-15 15.19 el9.aarch64 pigsty 10.0 MiB pgedge-15-15.19-2PGSTY.el9.aarch64.rpm
pgedge-15 15.19 el10.x86_64 pigsty 10.3 MiB pgedge-15-15.19-2PGSTY.el10.x86_64.rpm
pgedge-15 15.19 el10.aarch64 pigsty 10.1 MiB pgedge-15-15.19-2PGSTY.el10.aarch64.rpm
pgedge-15 15.19 d12.x86_64 pigsty 8.5 MiB pgedge-15_15.19-2PGSTY~bookworm_amd64.deb
pgedge-15 15.19 d12.aarch64 pigsty 8.2 MiB pgedge-15_15.19-2PGSTY~bookworm_arm64.deb
pgedge-15 15.19 d13.x86_64 pigsty 8.6 MiB pgedge-15_15.19-2PGSTY~trixie_amd64.deb
pgedge-15 15.19 d13.aarch64 pigsty 8.2 MiB pgedge-15_15.19-2PGSTY~trixie_arm64.deb
pgedge-15 15.19 u22.x86_64 pigsty 9.9 MiB pgedge-15_15.19-2PGSTY~jammy_amd64.deb
pgedge-15 15.19 u22.aarch64 pigsty 9.7 MiB pgedge-15_15.19-2PGSTY~jammy_arm64.deb
pgedge-15 15.19 u24.x86_64 pigsty 9.8 MiB pgedge-15_15.19-2PGSTY~noble_amd64.deb
pgedge-15 15.19 u24.aarch64 pigsty 9.6 MiB pgedge-15_15.19-2PGSTY~noble_arm64.deb
pgedge-15 15.19 u26.x86_64 pigsty 9.8 MiB pgedge-15_15.19-2PGSTY~resolute_amd64.deb
pgedge-15 15.19 u26.aarch64 pigsty 9.6 MiB pgedge-15_15.19-2PGSTY~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

Sources:

Configure and Enable

Assign each writing node a distinct nonzero lolor.node before creating large objects. Upstream documents values from 1 through 2^28. Configure the server’s parameter and create the extension in each participating database:

lolor.node = 1
CREATE EXTENSION lolor;
SET search_path = lolor, "$user", public, pg_catalog;

The control file fixes schema lolor, declares trusted installation and disallows relocation. The upstream README requires PostgreSQL 16 or newer; the current Pigsty pgEdge bundle has separately tested builds for 15–18. That packaging result does not establish support for arbitrary stock PostgreSQL 15 installations.

Large Object Workflow

WITH created AS (
  SELECT lo_from_bytea(0, convert_to('example data', 'UTF8')) AS oid
)
SELECT oid, convert_from(lo_get(oid), 'UTF8') AS contents FROM created;

Standard calls such as lo_create(), lo_get(), lo_put() and lo_unlink() use the replacement routines. Descriptor-based access through lo_open(), loread(), lowrite() and lo_close() must stay within the same transaction. File import/export operates on server-side paths and remains subject to the relevant function and filesystem privileges.

The extension uses lolor.pg_largeobject and lolor.pg_largeobject_metadata. Existing catalog routines are retained with renamed originals so disabling or removing the extension can restore the native function names.

Replication

With a configured Spock replication set, include both tables:

SELECT spock.repset_add_table('default', 'lolor.pg_largeobject');
SELECT spock.repset_add_table('default', 'lolor.pg_largeobject_metadata');

Install compatible versions and coordinate node identifiers and object ownership on every node. Creating the extension alone does not create a logical-replication topology.

Upgrade and Boundaries

Version 1.2.2 repairs extension and major-version upgrade behavior and adds lolor.disable(), lolor.enable() and lolor.is_enabled(). Update lolor before running pg_upgrade; the fix does not retroactively repair a major upgrade already attempted with older extension files:

ALTER EXTENSION lolor UPDATE TO '1.2.2';
SELECT lolor.is_enabled();

Disabling changes which native function names are active; it does not migrate stored large objects. Native large-object migration is not provided. Native large-object functionality and lolor storage cannot be used interchangeably while lolor is enabled. Upstream excludes ALTER LARGE OBJECT, GRANT ON LARGE OBJECT, COMMENT ON LARGE OBJECT and REVOKE ON LARGE OBJECT. Plan backup, restore and replication for both ordinary tables.