pg_stat_replication_slots

A statistics view showing statistics about logical replication slot usage
This entry relates to a PostgreSQL feature which is part of PostgreSQL 14, due to be released in late 2021.

pg_stat_replication_slots is a statistics view showing statistics about logical replication slot usage, specifically about transactions spilled to disk from the ReorderBuffer.

pg_stat_replication_slots was added in PostgreSQL 14.

Resetting statistics

Statistics for a particular logical replication slot can be reset by calling the function pg_stat_reset_replication_slot(slot_name).

Statistics for all logical replication slots can be reset by calling pg_stat_reset_replication_slot(NULL).

Definition by PostgreSQL version

pg_stat_replication_slots (PostgreSQL 15)

               View "pg_catalog.pg_stat_replication_slots"
    Column    |           Type           | Collation | Nullable | Default 
--------------+--------------------------+-----------+----------+---------
 slot_name    | text                     |           |          | 
 spill_txns   | bigint                   |           |          | 
 spill_count  | bigint                   |           |          | 
 spill_bytes  | bigint                   |           |          | 
 stream_txns  | bigint                   |           |          | 
 stream_count | bigint                   |           |          | 
 stream_bytes | bigint                   |           |          | 
 total_txns   | bigint                   |           |          | 
 total_bytes  | bigint                   |           |          | 
 stats_reset  | timestamp with time zone |           |          |
    

Documentation: pg_stat_replication_slots

pg_stat_replication_slots (PostgreSQL 14)

               View "pg_catalog.pg_stat_replication_slots"
    Column    |           Type           | Collation | Nullable | Default 
--------------+--------------------------+-----------+----------+---------
 slot_name    | text                     |           |          | 
 spill_txns   | bigint                   |           |          | 
 spill_count  | bigint                   |           |          | 
 spill_bytes  | bigint                   |           |          | 
 stream_txns  | bigint                   |           |          | 
 stream_count | bigint                   |           |          | 
 stream_bytes | bigint                   |           |          | 
 total_txns   | bigint                   |           |          | 
 total_bytes  | bigint                   |           |          | 
 stats_reset  | timestamp with time zone |           |          |
    

Documentation: pg_stat_replication_slots

Change history

Categories

Logical replication, Statistics / monitoring view

See also

pg_stat_reset_replication_slot()