Skip to content

Commit 2538d8a

Browse files
Susan Douglasmason-sharp
authored andcommitted
Initial check in of MkDocs content
1 parent 69e0386 commit 2538d8a

File tree

10 files changed

+217
-78
lines changed

10 files changed

+217
-78
lines changed

README.md

Lines changed: 17 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22

33
lolor is an extension that makes Postgres' Large Objects compatible with Logical Replication.
44

5-
PostgreSQL supports large objects as related chunks as described in the [pg_largeobject](https://www.postgresql.org/docs/17/catalog-pg-largeobject.html) table. Large objects provide stream-style access to user data stored in a special large-object structure in the catalog. Large objects stored in catalog tables require special handling during replication; the lolor extension allows for the storage of large objects in non-catalog tables, aiding in replication of large objects.
5+
## Table of Contents
6+
- [lolor Overview](docs/index.md)
7+
- [Building and Installing lolor](docs/install_configure.md)
8+
- [Basic Configuration](README.md#configuring-lolor)
9+
- [Using lolor](docs/using_lolor.md)
10+
- [Limitations](README.md#limitations)
611

7-
lolor creates and manages large object related tables in the lolor schema:
12+
PostgreSQL supports large objects as related chunks as described in the [pg_largeobject](https://www.postgresql.org/docs/current/catalog-pg-largeobject.html) table. Large objects provide stream-style access to user data stored in a special large-object structure in the catalog. Large objects stored in catalog tables require special handling during replication; the lolor extension allows for the storage of large objects in non-catalog tables, aiding in replication of large objects.
13+
14+
lolor creates and manages large object related tables in the `lolor` schema:
815

916
```
1017
lolor.pg_largeobject
@@ -13,41 +20,29 @@ lolor.pg_largeobject_metadata
1320

1421
PostgreSQL large objects allow you to store huge files within the database. Each large object is recognised by an OID that is assigned at the time of its creation. lolor stores objects in smaller segments within a separate system table and generates associated OIDs for large objects that are distinct from those of native large objects.
1522

16-
## Requirements
17-
Use of the lolor extension requires PostgreSQL 16 or newer.
18-
19-
## Installation
20-
21-
**Installing lolor with pgEdge binaries**
22-
23-
You can use the `pgedge` command line interface (CLI) to install the lolor extension (https://github.com/pgEdge/pgedge/blob/main/README.md).
24-
25-
To use pgEdge binaries to install lolor, go to [pgeEdge Github](https://github.com/pgEdge/pgedge) and install the pgEdge CLI:
26-
27-
`./pgedge install pg16 --start : install lolor`
23+
Use of the lolor extension requires Postgres 16 or newer.
2824

29-
**Installing lolor from source code**
25+
### Building and Installing lolor
3026

31-
You can also compile and install the extension from the source code, with the same guidelines as any other PostgreSQL extension constructed using PGXS.
32-
Make sure that your PATH environment variable includes the directory where `pg_config` (under your PostgreSQL installation) is located.
27+
You can also compile and install the extension from the source code, with the same guidelines as any other Postgres extension constructed using PGXS.
28+
Make sure that your PATH environment variable includes the directory where `pg_config` (under your Postgres installation) is located.
3329

3430
```
35-
export PATH=/opt/pg16/bin:$PATH
31+
export PATH=/opt/pg17/bin:$PATH
3632
3733
# compile
3834
make USE_PGXS=1
3935
# install, might be requiring sudo for the installation step
4036
make USE_PGXS=1 install
4137
```
4238

43-
After installing the lolor extension with either the pgEdge binary or from source code, connect to your Postgres database and create the extension with the command:
39+
After installing the lolor extension, connect to your Postgres database and create the extension with the command:
4440

4541
```
4642
CREATE EXTENSION lolor;
4743
```
4844

49-
50-
### Configuration
45+
### Configuring lolor
5146

5247
You must set the `lolor.node` parameter before using the extension. The value can be from 1 to 2^28; the value is used to help in generation of new large object OID.
5348

@@ -72,63 +67,7 @@ the following commands to add the tables:
7267
./pgedge spock repset-add-table spock_replication_set 'lolor.pg_largeobject_metadata' lolor_db
7368
```
7469

75-
### Example usage
76-
77-
```
78-
-- Create a large object with no data and return the oid:
79-
lolor_db=# SELECT lo_creat (-1);
80-
lo_creat
81-
----------
82-
1100433
83-
(1 row)
84-
85-
-- Querying the lolor schema for related stats:
86-
lolor_db=# SELECT * FROM lolor.pg_largeobject_metadata where oid = 1100433:
87-
oid | lomowner | lomacl
88-
---------+----------+--------
89-
1100433 | 10 |
90-
(1 row)
91-
92-
-- Creating an empty large object with oid 200000:
93-
lolor_db=# SELECT lo_create (200000);
94-
lo_create
95-
-----------
96-
200000
97-
(1 row)
98-
99-
-- Get related stats
100-
lolor_db=# SELECT * FROM lolor.pg_largeobject_metadata where oid = 200001:
101-
oid | lomowner | lomacl
102-
--------+----------+--------
103-
200001 | 10 |
104-
(1 row)
105-
106-
-- Import an operating system file as a large object:
107-
lolor_db=# SELECT lo_import ('/etc/os-release');
108-
lo_import
109-
-----------
110-
1100449
111-
(1 row)
112-
113-
-- Return information about the large object:
114-
lolor_db=# SELECT * FROM
115-
lolor.pg_largeobject where loid = 1100449;
116-
loid | pageno | data
117-
1100449 | 0 | \x5052455454595f4e414d453d2244656269616e20474e552f4c696e75782031322028626f6f6b776f726d29220a4e414d453d2244656269616e20474e552f4c696e7578220a56455
118-
253494f4e5f49443d223132220a56455253494f4e3d2231322028626f6f6b776f726d29220a56455253494f4e5f434f44454e414d453d626f6f6b776f726d0a49443d64656269616e0a484f4d455f55524c3d
119-
2268747470733a2f2f7777772e64656269616e2e6f72672f220a535550504f52545f55524c3d2268747470733a2f2f7777772e64656269616e2e6f72672f737570706f7274220a4255475f5245504f52545f5
120-
5524c3d2268747470733a2f2f627567732e64656269616e2e6f72672f220a
121-
(1 row)
122-
123-
-- Unlink a large object:
124-
lolor_db=# SELECT lo_unlink (1100449);
125-
lo_unlink
126-
-----------
127-
1
128-
(1 row)
129-
```
130-
131-
## Limitations
70+
### Limitations
13271

13372
- Native large object functionality cannot be used while you are using the lolor extension.
13473
- Native large object migration to the lolor feature is not available yet.

docs/img/favicon.ico

14.7 KB
Binary file not shown.

docs/img/logo-dark.png

31.3 KB
Loading

docs/img/logo-light.png

31.9 KB
Loading

docs/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# lolor - Managing Large Objects for Logical Replication
2+
3+
[lolor](https://github.com/pgEdge/lolor) is an extension that makes Postgres-style large objects compatible with logical Replication.
4+
5+
Postgres supports large objects as related chunks as described in the [pg_largeobject](https://www.postgresql.org/docs/current/catalog-pg-largeobject.html) table. Large objects provide stream-style access to user data stored in a special large-object structure in the catalog. Large objects stored in catalog tables require special handling during replication; the lolor extension allows for the storage of large objects in non-catalog tables, aiding in replication of large objects.
6+
7+
lolor creates and manages large object related tables in the `lolor` schema:
8+
9+
```
10+
lolor.pg_largeobject
11+
lolor.pg_largeobject_metadata
12+
```
13+
14+
Postgres large objects allow you to store large files within the database. Each large object is recognised by an OID that is assigned at the time of its creation. lolor stores objects in smaller segments within a separate system table and generates associated OIDs for large objects that are distinct from those of native large objects.
15+
16+
Use of the `lolor` extension requires Postgres 16 or newer.
17+
18+
19+
## Limitations
20+
21+
- Native Postgres large object functionality cannot be used while you are using the lolor extension.
22+
- Native large object migration to the lolor feature is not available yet.
23+
- lolor does not support the following statements: `ALTER LARGE OBJECT`, `GRANT ON LARGE OBJECT`, `COMMENT ON LARGE OBJECT`, and `REVOKE ON LARGE OBJECT`.

docs/install_configure.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Installing and Configuring lolor
2+
3+
lolor is supported on Postgres versions 16 and later.
4+
5+
You can use the CLI's Update Manager (`um`) module to install the lolor extension. After installing pgEdge Distributed Postgres, navigate into the `pgedge` directory and add lolor to your installation with the command:
6+
7+
`./pgedge um install lolor`
8+
9+
You can also compile and install the extension from the [source code](https://github.com/pgEdge/lolor), with the same guidelines as any other Postgres extension constructed using PGXS. Make sure that your PATH environment variable includes the directory where `pg_config` (under your PostgreSQL installation) is located.
10+
11+
```
12+
export PATH=/opt/pg16/bin:$PATH
13+
14+
# compile
15+
make USE_PGXS=1
16+
make USE_PGXS=1 install
17+
```
18+
19+
After installing the lolor extension with either the `um` module or from source code, connect to your Postgres database and create the extension with the command:
20+
21+
```
22+
CREATE EXTENSION lolor;
23+
```
24+
25+
## Configuring lolor
26+
27+
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 2^28; the value is used to help in generation of new large object OID.
28+
29+
```
30+
lolor.node = 1
31+
```
32+
33+
You can also change the `search_path` to pick large object related tables from the `lolor` schema:
34+
35+
```
36+
SET search_path=lolor,"$user",public,pg_catalog
37+
```
38+
39+
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.
40+
41+
While using `pgedge` replication with large objects, you must have the `pg_largeobject` and `pg_largeobject_metadata` tables in your replication set; use
42+
the following commands to add the tables:
43+
44+
```
45+
./pgedge spock repset-add-table spock_replication_set 'lolor.pg_largeobject' lolor_db
46+
./pgedge spock repset-add-table spock_replication_set 'lolor.pg_largeobject_metadata' lolor_db
47+
```

docs/overrides/partials/logo.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<img id="logo_dark_mode" src="{{ config.theme.logo_dark_mode | url }}" alt="logo">
2+
<img id="logo_light_mode" src="{{ config.theme.logo_light_mode | url }}" alt="logo">

docs/stylesheets/extra.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#logo_light_mode {
2+
display: var(--md-footer-logo-light-mode);
3+
}
4+
5+
#logo_dark_mode {
6+
display: var(--md-footer-logo-dark-mode);
7+
}
8+
9+
[data-md-color-scheme="default"] {
10+
--md-footer-logo-dark-mode: none;
11+
--md-footer-logo-light-mode: block;
12+
}
13+
14+
[data-md-color-scheme="slate"] {
15+
--md-footer-logo-dark-mode: block;
16+
--md-footer-logo-light-mode: none;
17+
}

docs/using_lolor.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Using lolor
2+
3+
The following command examples demonstrate using lolor:
4+
5+
```
6+
-- Create a large object with no data and return the oid:
7+
lolor_db=# SELECT lo_creat (-1);
8+
lo_creat
9+
----------
10+
1100433
11+
(1 row)
12+
13+
-- Querying the lolor schema for related stats:
14+
lolor_db=# SELECT * FROM lolor.pg_largeobject_metadata where oid = 1100433:
15+
oid | lomowner | lomacl
16+
---------+----------+--------
17+
1100433 | 10 |
18+
(1 row)
19+
20+
-- Creating an empty large object with oid 200000:
21+
lolor_db=# SELECT lo_create (200000);
22+
lo_create
23+
-----------
24+
200000
25+
(1 row)
26+
27+
-- Get related stats
28+
lolor_db=# SELECT * FROM lolor.pg_largeobject_metadata where oid = 200001:
29+
oid | lomowner | lomacl
30+
--------+----------+--------
31+
200001 | 10 |
32+
(1 row)
33+
34+
-- Import an operating system file as a large object:
35+
lolor_db=# SELECT lo_import ('/etc/os-release');
36+
lo_import
37+
-----------
38+
1100449
39+
(1 row)
40+
41+
-- Return information about the large object:
42+
lolor_db=# SELECT * FROM
43+
lolor.pg_largeobject where loid = 1100449;
44+
loid | pageno | data
45+
1100449 | 0 | \x5052455454595f4e414d453d2244656269616e20474e552f4c696e75782031322028626f6f6b776f726d29220a4e414d453d2244656269616e20474e552f4c696e7578220a56455
46+
253494f4e5f49443d223132220a56455253494f4e3d2231322028626f6f6b776f726d29220a56455253494f4e5f434f44454e414d453d626f6f6b776f726d0a49443d64656269616e0a484f4d455f55524c3d
47+
2268747470733a2f2f7777772e64656269616e2e6f72672f220a535550504f52545f55524c3d2268747470733a2f2f7777772e64656269616e2e6f72672f737570706f7274220a4255475f5245504f52545f5
48+
5524c3d2268747470733a2f2f627567732e64656269616e2e6f72672f220a
49+
(1 row)
50+
51+
-- Unlink a large object:
52+
lolor_db=# SELECT lo_unlink (1100449);
53+
lo_unlink
54+
-----------
55+
1
56+
(1 row)
57+
```

mkdocs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
site_name: lolor
2+
3+
extra_css:
4+
- stylesheets/extra.css
5+
6+
markdown_extensions:
7+
- admonition
8+
- pymdownx.details
9+
- pymdownx.superfences
10+
11+
plugins:
12+
- search
13+
14+
theme:
15+
name: material
16+
custom_dir: docs/overrides
17+
18+
logo_dark_mode: 'img/logo-dark.png'
19+
logo_light_mode: 'img/logo-light.png'
20+
21+
features:
22+
- navigation.instant
23+
- navigation.tracking
24+
- navigation.prune
25+
- navigation.top
26+
- toc.follow
27+
28+
palette:
29+
- media: "(prefers-color-scheme: light)"
30+
scheme: default
31+
primary: white
32+
accent: cyan
33+
toggle:
34+
icon: material/brightness-7
35+
name: Switch to dark mode
36+
37+
- media: "(prefers-color-scheme: dark)"
38+
scheme: slate
39+
primary: black
40+
accent: cyan
41+
toggle:
42+
icon: material/brightness-4
43+
name: Switch to system preference
44+
45+
extra:
46+
generator: false
47+
48+
copyright: Copyright &copy; 2023 - 2025 pgEdge, Inc
49+
repo_url: https://github.com/pgEdge/lolor
50+
51+
nav:
52+
- lolor Overview: index.md
53+
- Building and Installing lolor: docs/install_configure.md
54+
- Using lolor: docs/using_lolor.md

0 commit comments

Comments
 (0)