1 /*-------------------------------------------------------------------------
5 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8 * src/bin/pg_basebackup/receivelog.h
9 *-------------------------------------------------------------------------
15 #include "access/xlogdefs.h"
17 #include "walmethods.h"
20 * Called before trying to read more data or when a segment is
21 * finished. Return true to stop streaming.
23 typedef bool (*stream_stop_callback
) (XLogRecPtr segendpos
, uint32 timeline
, bool segment_finished
);
26 * Global parameters when receiving xlog stream. For details about the individual fields,
27 * see the function comment for ReceiveXlogStream().
29 typedef struct StreamCtl
31 XLogRecPtr startpos
; /* Start position for streaming */
32 TimeLineID timeline
; /* Timeline to stream data from */
33 char *sysidentifier
; /* Validate this system identifier and
35 int standby_message_timeout
; /* Send status messages this often */
36 bool synchronous
; /* Flush immediately WAL data on write */
37 bool mark_done
; /* Mark segment as done in generated archive */
38 bool do_sync
; /* Flush to disk to ensure consistent state of
41 stream_stop_callback stream_stop
; /* Stop streaming when returns true */
43 pgsocket stop_socket
; /* if valid, watch for input on this socket
44 * and check stream_stop() when there is any */
46 WalWriteMethod
*walmethod
; /* How to write the WAL */
47 char *partial_suffix
; /* Suffix appended to partially received files */
48 char *replication_slot
; /* Replication slot to use, or NULL */
53 extern bool CheckServerVersionForStreaming(PGconn
*conn
);
54 extern bool ReceiveXlogStream(PGconn
*conn
,
57 #endif /* RECEIVELOG_H */