From d811c037cea2e929ee5823aab6e1bca0df8be245 Mon Sep 17 00:00:00 2001
From: Andres Freund
Date: Tue, 21 Apr 2015 11:51:06 +0200
Subject: Add 'active_in' column to pg_replication_slots.
Right now it is visible whether a replication slot is active in any
session, but not in which. Adding the active_in column, containing the
pid of the backend having acquired the slot, makes it much easier to
associate pg_replication_slots entries with the corresponding
pg_stat_replication/pg_stat_activity row.
This should have been done from the start, but I (Andres) dropped the
ball there somehow.
Author: Craig Ringer, revised by me Discussion:
CAMsr+YFKgZca5_7_ouaMWxA5PneJC9LNViPzpDHusaPhU9pA7g@mail.gmail.com
---
doc/src/sgml/catalogs.sgml | 10 ++++++++++
doc/src/sgml/logicaldecoding.sgml | 8 ++++----
2 files changed, 14 insertions(+), 4 deletions(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index d0b78f27827..98847354bd0 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -5400,6 +5400,16 @@
True if this slot is currently actively being used
+
+ active_in
+ integer
+
+ The process ID of the session using this slot if the slot
+ is currently actively being used. NULL if
+ inactive.
+
+
+
xmin
xid
diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index 36505678526..0810a2d1f97 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -62,10 +62,10 @@ postgres=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', '
regression_slot | 0/16B1970
(1 row)
-postgres=# SELECT * FROM pg_replication_slots;
- slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn
------------------+---------------+-----------+--------+----------+--------+--------+--------------+-------------
- regression_slot | test_decoding | logical | 12052 | postgres | f | | 684 | 0/16A4408
+postgres=# SELECT slot_name, plugin, slot_type, database, active, restart_lsn FROM pg_replication_slots;
+ slot_name | plugin | slot_type | database | active | restart_lsn
+-----------------+---------------+-----------+----------+--------+-------------
+ regression_slot | test_decoding | logical | postgres | f | 0/16A4408
(1 row)
postgres=# -- There are no changes to see yet
--
cgit v1.2.3