aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-07-02 13:57:03 +0900
committerMichael Paquier <michael@paquier.xyz>2020-07-02 13:57:03 +0900
commit641dd167a3424f97eed8416b5ef1c21dbbf8cf12 (patch)
tree337592fa1a5d71dea10b5b9b60e4c07ac09b0cdf /src/backend
parent4315e8c23b9a897e12fcf91de7bfd734621096bf (diff)
downloadpostgresql-641dd167a3424f97eed8416b5ef1c21dbbf8cf12.tar.gz
postgresql-641dd167a3424f97eed8416b5ef1c21dbbf8cf12.zip
Move description of libpqwalreceiver hooks out of the replication's README
src/backend/replication/README includes since 32bc08b a basic description of the WAL receiver hooks available in walreceiver.h for a module like libpqwalreceiver, but the README has never been updated to reflect changes done to the hooks, so the contents of the README have rotten with the time. This commit moves the description from the README to walreceiver.h, where it will be hard to miss that a description update or addition is needed depending on the modifications done to the hooks. Each hook now includes a description of what it does in walreceiver.h, and the replication's README mentions walreceiver.h. Thanks also to Amit Kapila for the discussion. Author: Michael Paquier Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/20200502024606.GA471944@paquier.xyz
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/replication/README29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/backend/replication/README b/src/backend/replication/README
index 8ccdd86e74b..eae6ca729f4 100644
--- a/src/backend/replication/README
+++ b/src/backend/replication/README
@@ -8,33 +8,8 @@ the primary server, receiving WAL files and sending messages, is loaded
dynamically to avoid having to link the main server binary with libpq.
The dynamically loaded module is in libpqwalreceiver subdirectory.
-The dynamically loaded module implements four functions:
-
-
-bool walrcv_connect(char *conninfo, XLogRecPtr startpoint)
-
-Establish connection to the primary, and starts streaming from 'startpoint'.
-Returns true on success.
-
-int walrcv_receive(char **buffer, pgsocket *wait_fd)
-
-Retrieve any message available without blocking through the
-connection. If a message was successfully read, returns its
-length. If the connection is closed, returns -1. Otherwise returns 0
-to indicate that no data is available, and sets *wait_fd to a socket
-descriptor which can be waited on before trying again. On success, a
-pointer to the message payload is stored in *buffer. The returned
-buffer is valid until the next call to walrcv_* functions, and the
-caller should not attempt to free it.
-
-void walrcv_send(const char *buffer, int nbytes)
-
-Send a message to XLOG stream.
-
-void walrcv_disconnect(void);
-
-Disconnect.
-
+The dynamically loaded module implements a set of functions with details
+about each one of them provided in src/include/replication/walreceiver.h.
This API should be considered internal at the moment, but we could open it
up for 3rd party replacements of libpqwalreceiver in the future, allowing