Skip to content

Commit dfe530a

Browse files
committed
Improve documentation about pg_stat_replication view.
Add the descriptions of possible values in "state" and "sync_state" columns of pg_stat_replication view. Author: Michael Paquier, slightly modified by me Discussion: <CAB7nPqT7APWrvPFZrcjKEHoq4=g3z2ErxtTdojSf+sDALzuemA@mail.gmail.com>
1 parent 3ebf2b4 commit dfe530a

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

doc/src/sgml/high-availability.sgml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,10 @@ synchronous_standby_names = '2 (s1, s2, s3)'
11611161
<literal>s2</> fails. <literal>s4</> is an asynchronous standby since
11621162
its name is not in the list.
11631163
</para>
1164+
<para>
1165+
The synchronous states of standby servers can be viewed using
1166+
the <structname>pg_stat_replication</structname> view.
1167+
</para>
11641168
</sect3>
11651169

11661170
<sect3 id="synchronous-replication-performance">
@@ -1235,6 +1239,8 @@ synchronous_standby_names = '2 (s1, s2, s3)'
12351239
will increase according to the length of time the standby has been down.
12361240
The standby is only able to become a synchronous standby
12371241
once it has reached <literal>streaming</> state.
1242+
This state can be viewed using
1243+
the <structname>pg_stat_replication</structname> view.
12381244
</para>
12391245

12401246
<para>

doc/src/sgml/monitoring.sgml

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,33 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
13571357
<row>
13581358
<entry><structfield>state</></entry>
13591359
<entry><type>text</></entry>
1360-
<entry>Current WAL sender state</entry>
1360+
<entry>Current WAL sender state.
1361+
Possible values are:
1362+
<itemizedlist>
1363+
<listitem>
1364+
<para>
1365+
<literal>startup</>: This WAL sender is starting up.
1366+
</para>
1367+
</listitem>
1368+
<listitem>
1369+
<para>
1370+
<literal>catchup</>: This WAL sender's connected standby is
1371+
catching up with the primary.
1372+
</para>
1373+
</listitem>
1374+
<listitem>
1375+
<para>
1376+
<literal>streaming</>: This WAL sender is streaming changes
1377+
after its connected standby server has caught up with the primary.
1378+
</para>
1379+
</listitem>
1380+
<listitem>
1381+
<para>
1382+
<literal>backup</>: This WAL sender is sending a backup.
1383+
</para>
1384+
</listitem>
1385+
</itemizedlist>
1386+
</entry>
13611387
</row>
13621388
<row>
13631389
<entry><structfield>sent_location</></entry>
@@ -1391,7 +1417,28 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
13911417
<row>
13921418
<entry><structfield>sync_state</></entry>
13931419
<entry><type>text</></entry>
1394-
<entry>Synchronous state of this standby server</entry>
1420+
<entry>Synchronous state of this standby server.
1421+
Possible values are:
1422+
<itemizedlist>
1423+
<listitem>
1424+
<para>
1425+
<literal>async</>: This standby server is asynchronous.
1426+
</para>
1427+
</listitem>
1428+
<listitem>
1429+
<para>
1430+
<literal>potential</>: This standby server is now asynchronous,
1431+
but can potentially become synchronous if one of current
1432+
synchronous ones fails.
1433+
</para>
1434+
</listitem>
1435+
<listitem>
1436+
<para>
1437+
<literal>sync</>: This standby server is synchronous.
1438+
</para>
1439+
</listitem>
1440+
</itemizedlist>
1441+
</entry>
13951442
</row>
13961443
</tbody>
13971444
</tgroup>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy