# Installing and Configuring lolor

> lolor is supported on Postgres versions 16 and later.

---

LLMS index: [llms.txt](/llms.txt)

---

> Upstream reference for LOLOR 1.3.0-dev. Mimus 19.0.1 integrates [Spock 5.0.15](/docs/spock/). Compatibility of LOLOR with Mimus is unverified.

lolor is supported on Postgres versions 16 and later.

lolor ships with pgEdge Distributed Postgres and pgEdge Enterprise Postgres, so a pgEdge deployment provides the extension for you. The Control Plane installs the lolor package on each node as part of standard cluster setup.

If you manage Postgres yourself, you can compile and install the extension from the [source code](https://github.com/pgEdge/lolor), following the same guidelines as any other Postgres extension built with PGXS.  Make sure that your PATH environment variable includes the directory where `pg_config` (under your PostgreSQL installation) is located.

```
export PATH=/opt/pg16/bin:$PATH

# compile
make USE_PGXS=1
make USE_PGXS=1 install
```

lolor must be loaded at server start. Add it to `shared_preload_libraries` in `postgresql.conf` and restart; `CREATE EXTENSION lolor`, `LOAD 'lolor'` and any call that reaches one of lolor's functions fail with `lolor must be loaded via "shared_preload_libraries"` when the library was loaded on demand; the native `pg_catalog.lo_*` functions are not affected while lolor is not installed or is disabled. The guard that protects large objects when the extension is dropped is an object access hook, which is only in place in every backend when the library is preloaded.

```
shared_preload_libraries = 'lolor'
```

Then connect to your Postgres database and create the extension with the command:

```
CREATE EXTENSION lolor;
```

## Configuring lolor {#configuring-lolor}

You must set the `lolor.node` parameter on each node in your replication cluster before using the extension. The value can be from 1 to 15 (0 means unset); it is encoded in the four low bits of every large object OID lolor generates, so each node must use a different value.

```
lolor.node = 1
```

You can also change the `search_path` to pick large object related tables from the `lolor` schema:

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

lolor renames any existing methods in `pg_catalog.lo_*` to `pg_catalog.lo_*_orig`, and new versions of these methods are introduced.  If you remove the extension, the renamed `pg_catalog.lo_*_orig` functions are restored to their initial names.

When you replicate large objects with Spock, the tables `pg_largeobject`, `pg_largeobject_metadata` and `pg_largeobject_description` must belong to your replication set. The third table holds the comment of each object that was migrated from native storage; without it, a `lo_unlink()` leaves the comment behind on the other nodes, and a node that is added or resynchronized later does not receive the comments. Connect to the lolor database and add them with `spock.repset_add_table`:

```sql
-- 'default' is Spock's built-in replication set; subscriptions consume it automatically.
SELECT spock.repset_add_table('default', 'lolor.pg_largeobject');
SELECT spock.repset_add_table('default', 'lolor.pg_largeobject_metadata');
SELECT spock.repset_add_table('default', 'lolor.pg_largeobject_description');
```

---

[Upstream source](https://github.com/pgEdge/lolor/blob/1548836b0df0819e5415a9d0574afd93e9a64f1d/docs/install_configure.md) · `1548836b0df0` · Copyright (c) 2024–2026, pgEdge, Inc. [PostgreSQL License](/docs/spock/upstream/about/license/).

[PG.CENTER edition](https://github.com/pgsty/doc.pg.center/blob/4410c32dc9186a22859008303f474b72a779f583/content/pgedge/lolor/install-configure.md)

---

Backlinks:

- [LOLOR](/docs/spock/upstream/lolor/)
