pg_largeobject

A system table containing large object data

pg_largeobject is a system catalogue table containing large object (LO) data.

pg_largeobject was added in PostgreSQL 7.1.

psql commands

\dl or \lo_list list available large objects.

Definition by PostgreSQL version

pg_largeobject (PostgreSQL 15)

         Table "pg_catalog.pg_largeobject"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 loid   | oid     |           | not null | 
 pageno | integer |           | not null | 
 data   | bytea   |           | not null | 
Indexes:
    "pg_largeobject_loid_pn_index" PRIMARY KEY, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 14)

         Table "pg_catalog.pg_largeobject"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 loid   | oid     |           | not null | 
 pageno | integer |           | not null | 
 data   | bytea   |           | not null | 
Indexes:
    "pg_largeobject_loid_pn_index" PRIMARY KEY, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 13)

         Table "pg_catalog.pg_largeobject"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 loid   | oid     |           | not null | 
 pageno | integer |           | not null | 
 data   | bytea   |           | not null | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 12)

         Table "pg_catalog.pg_largeobject"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 loid   | oid     |           | not null | 
 pageno | integer |           | not null | 
 data   | bytea   |           | not null | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 11)

         Table "pg_catalog.pg_largeobject"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 loid   | oid     |           | not null | 
 pageno | integer |           | not null | 
 data   | bytea   |           | not null | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 10)

         Table "pg_catalog.pg_largeobject"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 loid   | oid     |           | not null | 
 pageno | integer |           | not null | 
 data   | bytea   |           | not null | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.6)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | not null
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.5)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | not null
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.4)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.3)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.2)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.1)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 9.0)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 8.4)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 8.3)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

pg_largeobject (PostgreSQL 8.2)

Table "pg_catalog.pg_largeobject"
 Column |  Type   | Modifiers 
--------+---------+-----------
 loid   | oid     | not null
 pageno | integer | not null
 data   | bytea   | 
Indexes:
    "pg_largeobject_loid_pn_index" UNIQUE, btree (loid, pageno)
    

Documentation: pg_largeobject

Change history

Examples

Basic usage of pg_largeobject (using psql's large object slash commands):

postgres=# SELECT * FROM pg_largeobject;
 loid | pageno | data
------+--------+------
(0 rows)

postgres=# \lo_import /tmp/hello-world.txt
lo_import 16455

postgres=# SELECT * FROM pg_largeobject;
 loid  | pageno |             data
-------+--------+------------------------------
 16455 |      0 | \x48656c6c6f20776f726c64210a
(1 row)

postgres=# \lo_unlink 16455
lo_unlink 16455

postgres=# SELECT * FROM pg_largeobject;
 loid | pageno | data
------+--------+------
(0 rows)

Categories

Data type, Large object, Storage, System catalogue

See also

pg_largeobject_metadata