Improve documentation about pg_stat_replication view.
authorFujii Masao
Tue, 6 Dec 2016 08:09:10 +0000 (17:09 +0900)
committerFujii Masao
Tue, 6 Dec 2016 08:09:10 +0000 (17:09 +0900)
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: 

doc/src/sgml/high-availability.sgml
doc/src/sgml/monitoring.sgml

index 5bedaf27a290cd691f2f589aa434f6c771356735..6b89507c8c93d6d340762084b75575b6cf2c0705 100644 (file)
@@ -1161,6 +1161,10 @@ synchronous_standby_names = '2 (s1, s2, s3)'
     s2 fails. s4 is an asynchronous standby since
     its name is not in the list.
    
+   
+    The synchronous states of standby servers can be viewed using
+    the pg_stat_replication view.
+   
    
 
    
@@ -1235,6 +1239,8 @@ synchronous_standby_names = '2 (s1, s2, s3)'
     will increase according to the length of time the standby has been down.
     The standby is only able to become a synchronous standby
     once it has reached streaming state.
+    This state can be viewed using
+    the pg_stat_replication view.
    
 
    
index 02dab879d9bbacace60693faab8ae3dabb3f2ca6..128ee13b5f7f2230b46b028a3df8f31b55c122c7 100644 (file)
@@ -1357,7 +1357,33 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     
      state
      text
-     Current WAL sender state
+     Current WAL sender state.
+       Possible values are:
+       
+         
+          
+           startup: This WAL sender is starting up.
+          
+         
+         
+          
+           catchup: This WAL sender's connected standby is
+           catching up with the primary.
+          
+         
+         
+          
+           streaming: This WAL sender is streaming changes
+           after its connected standby server has caught up with the primary.
+          
+         
+         
+          
+           backup: This WAL sender is sending a backup.
+          
+         
+       
+     
     
     
      sent_location
@@ -1391,7 +1417,28 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     
      sync_state
      text
-     Synchronous state of this standby server
+     Synchronous state of this standby server.
+       Possible values are:
+       
+         
+          
+           async: This standby server is asynchronous.
+          
+         
+         
+          
+           potential: This standby server is now asynchronous,
+           but can potentially become synchronous if one of current
+           synchronous ones fails.
+          
+         
+         
+          
+           sync: This standby server is synchronous.
+          
+         
+       
+