pg_replication_slots

A system view listing all replication slots

pg_replication_slots is a system catalogue view listing all replication slots.

pg_replication_slots was added in PostgreSQL 9.4.

Definition by PostgreSQL version

pg_replication_slots (PostgreSQL 15)

             View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Collation | Nullable | Default 
---------------------+---------+-----------+----------+---------
 slot_name           | name    |           |          | 
 plugin              | name    |           |          | 
 slot_type           | text    |           |          | 
 datoid              | oid     |           |          | 
 database            | name    |           |          | 
 temporary           | boolean |           |          | 
 active              | boolean |           |          | 
 active_pid          | integer |           |          | 
 xmin                | xid     |           |          | 
 catalog_xmin        | xid     |           |          | 
 restart_lsn         | pg_lsn  |           |          | 
 confirmed_flush_lsn | pg_lsn  |           |          | 
 wal_status          | text    |           |          | 
 safe_wal_size       | bigint  |           |          | 
 two_phase           | boolean |           |          |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 14)

             View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Collation | Nullable | Default 
---------------------+---------+-----------+----------+---------
 slot_name           | name    |           |          | 
 plugin              | name    |           |          | 
 slot_type           | text    |           |          | 
 datoid              | oid     |           |          | 
 database            | name    |           |          | 
 temporary           | boolean |           |          | 
 active              | boolean |           |          | 
 active_pid          | integer |           |          | 
 xmin                | xid     |           |          | 
 catalog_xmin        | xid     |           |          | 
 restart_lsn         | pg_lsn  |           |          | 
 confirmed_flush_lsn | pg_lsn  |           |          | 
 wal_status          | text    |           |          | 
 safe_wal_size       | bigint  |           |          | 
 two_phase           | boolean |           |          |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 13)

             View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Collation | Nullable | Default 
---------------------+---------+-----------+----------+---------
 slot_name           | name    |           |          | 
 plugin              | name    |           |          | 
 slot_type           | text    |           |          | 
 datoid              | oid     |           |          | 
 database            | name    |           |          | 
 temporary           | boolean |           |          | 
 active              | boolean |           |          | 
 active_pid          | integer |           |          | 
 xmin                | xid     |           |          | 
 catalog_xmin        | xid     |           |          | 
 restart_lsn         | pg_lsn  |           |          | 
 confirmed_flush_lsn | pg_lsn  |           |          | 
 wal_status          | text    |           |          | 
 safe_wal_size       | bigint  |           |          |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 12)

             View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Collation | Nullable | Default 
---------------------+---------+-----------+----------+---------
 slot_name           | name    |           |          | 
 plugin              | name    |           |          | 
 slot_type           | text    |           |          | 
 datoid              | oid     |           |          | 
 database            | name    |           |          | 
 temporary           | boolean |           |          | 
 active              | boolean |           |          | 
 active_pid          | integer |           |          | 
 xmin                | xid     |           |          | 
 catalog_xmin        | xid     |           |          | 
 restart_lsn         | pg_lsn  |           |          | 
 confirmed_flush_lsn | pg_lsn  |           |          |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 11)

             View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Collation | Nullable | Default 
---------------------+---------+-----------+----------+---------
 slot_name           | name    |           |          | 
 plugin              | name    |           |          | 
 slot_type           | text    |           |          | 
 datoid              | oid     |           |          | 
 database            | name    |           |          | 
 temporary           | boolean |           |          | 
 active              | boolean |           |          | 
 active_pid          | integer |           |          | 
 xmin                | xid     |           |          | 
 catalog_xmin        | xid     |           |          | 
 restart_lsn         | pg_lsn  |           |          | 
 confirmed_flush_lsn | pg_lsn  |           |          |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 10)

             View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Collation | Nullable | Default 
---------------------+---------+-----------+----------+---------
 slot_name           | name    |           |          | 
 plugin              | name    |           |          | 
 slot_type           | text    |           |          | 
 datoid              | oid     |           |          | 
 database            | name    |           |          | 
 temporary           | boolean |           |          | 
 active              | boolean |           |          | 
 active_pid          | integer |           |          | 
 xmin                | xid     |           |          | 
 catalog_xmin        | xid     |           |          | 
 restart_lsn         | pg_lsn  |           |          | 
 confirmed_flush_lsn | pg_lsn  |           |          |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 9.6)

  View "pg_catalog.pg_replication_slots"
       Column        |  Type   | Modifiers 
---------------------+---------+-----------
 slot_name           | name    | 
 plugin              | name    | 
 slot_type           | text    | 
 datoid              | oid     | 
 database            | name    | 
 active              | boolean | 
 active_pid          | integer | 
 xmin                | xid     | 
 catalog_xmin        | xid     | 
 restart_lsn         | pg_lsn  | 
 confirmed_flush_lsn | pg_lsn  |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 9.5)

View "pg_catalog.pg_replication_slots"
    Column    |  Type   | Modifiers 
--------------+---------+-----------
 slot_name    | name    | 
 plugin       | name    | 
 slot_type    | text    | 
 datoid       | oid     | 
 database     | name    | 
 active       | boolean | 
 active_pid   | integer | 
 xmin         | xid     | 
 catalog_xmin | xid     | 
 restart_lsn  | pg_lsn  |
    

Documentation: pg_replication_slots

pg_replication_slots (PostgreSQL 9.4)

View "pg_catalog.pg_replication_slots"
    Column    |  Type   | Modifiers 
--------------+---------+-----------
 slot_name    | name    | 
 plugin       | name    | 
 slot_type    | text    | 
 datoid       | oid     | 
 database     | name    | 
 active       | boolean | 
 xmin         | xid     | 
 catalog_xmin | xid     | 
 restart_lsn  | pg_lsn  |
    

Documentation: pg_replication_slots

Change history

Examples

Sample contents of pg_replication_slots (as of PostgreSQL 13) when a single physical replication slot is in use:

postgres=# SELECT * FROM pg_replication_slots\gx
-[ RECORD 1 ]-------+--------------
slot_name           | node2
plugin              |
slot_type           | physical
datoid              |
database            |
temporary           | f
active              | t
active_pid          | 1597000
xmin                |
catalog_xmin        |
restart_lsn         | 0/3002470
confirmed_flush_lsn |
wal_status          | reserved
safe_wal_size       |

Categories

Logical replication, Replication, System catalogue

See also

pg_create_logical_replication_slot(), pg_create_physical_replication_slot(), pg_drop_replication_slot()