2014-08-27 12:31:48 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* receivelog.h
|
|
|
|
*
|
2015-01-06 17:43:47 +01:00
|
|
|
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
|
2014-08-27 12:31:48 +02:00
|
|
|
*
|
|
|
|
* IDENTIFICATION
|
|
|
|
* src/bin/pg_basebackup/receivelog.h
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RECEIVELOG_H
|
|
|
|
#define RECEIVELOG_H
|
|
|
|
|
2014-03-18 17:19:57 +01:00
|
|
|
#include "libpq-fe.h"
|
|
|
|
|
2011-10-26 20:13:33 +02:00
|
|
|
#include "access/xlogdefs.h"
|
|
|
|
|
|
|
|
/*
|
2012-05-25 11:36:22 +02:00
|
|
|
* Called before trying to read more data or when a segment is
|
|
|
|
* finished. Return true to stop streaming.
|
2011-10-26 20:13:33 +02:00
|
|
|
*/
|
2012-06-10 21:20:04 +02:00
|
|
|
typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
|
2011-10-26 20:13:33 +02:00
|
|
|
|
Make pg_basebackup work with pre-9.3 servers, and add server version check.
A new 'starttli' field was added to the response of BASE_BACKUP command.
Make pg_basebackup tolerate the case that it's missing, so that it still
works with older servers.
Add an explicit check for the server version, so that you get a nicer error
message if you try to use it with a pre-9.1 server.
The streaming protocol message format changed in 9.3, so -X stream still won't
work with pre-9.3 servers. I added a version check to ReceiveXLogStream()
earlier, but write that slightly differently, so that in 9.4, it will still
work with a 9.3 server. (In 9.4, the error message needs to be adjusted to
"9.3 or above", though). Also, if the version check fails, don't retry.
2013-03-22 12:02:59 +01:00
|
|
|
extern bool CheckServerVersionForStreaming(PGconn *conn);
|
2011-10-26 20:13:33 +02:00
|
|
|
extern bool ReceiveXlogStream(PGconn *conn,
|
2012-06-10 21:20:04 +02:00
|
|
|
XLogRecPtr startpos,
|
|
|
|
uint32 timeline,
|
|
|
|
char *sysidentifier,
|
|
|
|
char *basedir,
|
|
|
|
stream_stop_callback stream_stop,
|
|
|
|
int standby_message_timeout,
|
2014-08-08 09:50:54 +02:00
|
|
|
char *partial_suffix,
|
2015-01-03 20:51:52 +01:00
|
|
|
bool synchronous,
|
|
|
|
bool mark_done);
|
2014-08-27 12:31:48 +02:00
|
|
|
|
|
|
|
#endif /* RECEIVELOG_H */
|