PostgreSQL Source Code
git master
Loading...
Searching...
No Matches
receivelog.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* receivelog.h
4
*
5
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
6
*
7
* IDENTIFICATION
8
* src/bin/pg_basebackup/receivelog.h
9
*-------------------------------------------------------------------------
10
*/
11
12
#ifndef RECEIVELOG_H
13
#define RECEIVELOG_H
14
15
#include "
access/xlogdefs.h
"
16
#include "
libpq-fe.h
"
17
#include "
walmethods.h
"
18
19
/*
20
* Called before trying to read more data or when a segment is
21
* finished. Return true to stop streaming.
22
*/
23
typedef
bool
(*
stream_stop_callback
) (
XLogRecPtr
segendpos
,
uint32
timeline,
bool
segment_finished
);
24
25
/*
26
* Global parameters when receiving xlog stream. For details about the individual fields,
27
* see the function comment for ReceiveXlogStream().
28
*/
29
typedef
struct
StreamCtl
30
{
31
XLogRecPtr
startpos
;
/* Start position for streaming */
32
TimeLineID
timeline
;
/* Timeline to stream data from */
33
char
*
sysidentifier
;
/* Validate this system identifier and
34
* timeline */
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
39
* data */
40
41
stream_stop_callback
stream_stop
;
/* Stop streaming when returns true */
42
43
pgsocket
stop_socket
;
/* if valid, watch for input on this socket
44
* and check stream_stop() when there is any */
45
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 */
49
}
StreamCtl
;
50
51
52
53
extern
bool
CheckServerVersionForStreaming
(
PGconn
*
conn
);
54
extern
bool
ReceiveXlogStream
(
PGconn
*
conn
,
55
StreamCtl
*stream);
56
57
#endif
/* RECEIVELOG_H */
uint32
uint32_t uint32
Definition
c.h:546
libpq-fe.h
pgsocket
int pgsocket
Definition
port.h:29
fb
static int fb(int x)
Definition
preproc-init.c:92
stream_stop_callback
bool(* stream_stop_callback)(XLogRecPtr segendpos, uint32 timeline, bool segment_finished)
Definition
receivelog.h:23
ReceiveXlogStream
bool ReceiveXlogStream(PGconn *conn, StreamCtl *stream)
Definition
receivelog.c:453
CheckServerVersionForStreaming
bool CheckServerVersionForStreaming(PGconn *conn)
Definition
receivelog.c:375
conn
PGconn * conn
Definition
streamutil.c:52
StreamCtl
Definition
receivelog.h:30
StreamCtl::sysidentifier
char * sysidentifier
Definition
receivelog.h:33
StreamCtl::timeline
TimeLineID timeline
Definition
receivelog.h:32
StreamCtl::stream_stop
stream_stop_callback stream_stop
Definition
receivelog.h:41
StreamCtl::replication_slot
char * replication_slot
Definition
receivelog.h:48
StreamCtl::startpos
XLogRecPtr startpos
Definition
receivelog.h:31
StreamCtl::do_sync
bool do_sync
Definition
receivelog.h:38
StreamCtl::stop_socket
pgsocket stop_socket
Definition
receivelog.h:43
StreamCtl::standby_message_timeout
int standby_message_timeout
Definition
receivelog.h:35
StreamCtl::walmethod
WalWriteMethod * walmethod
Definition
receivelog.h:46
StreamCtl::mark_done
bool mark_done
Definition
receivelog.h:37
StreamCtl::partial_suffix
char * partial_suffix
Definition
receivelog.h:47
StreamCtl::synchronous
bool synchronous
Definition
receivelog.h:36
WalWriteMethod
Definition
walmethods.h:104
pg_conn
Definition
libpq-int.h:372
walmethods.h
xlogdefs.h
XLogRecPtr
uint64 XLogRecPtr
Definition
xlogdefs.h:21
TimeLineID
uint32 TimeLineID
Definition
xlogdefs.h:63
src
bin
pg_basebackup
receivelog.h
Generated on Thu Jan 29 2026 06:13:15 for PostgreSQL Source Code by
1.9.8