1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Refactor replication connection code of various pg_basebackup utilities.

Move some more code to manage replication connection command to
streamutil.c. A later patch will introduce replication slot via
pg_receivexlog and this avoid duplicating relevant code between
pg_receivexlog and pg_recvlogical.

Author: Michael Paquier, with some editing by me.
This commit is contained in:
Andres Freund
2014-10-01 17:22:21 +02:00
parent fdf81c9a6c
commit 0c013e08cf
5 changed files with 223 additions and 142 deletions

View File

@@ -14,6 +14,8 @@
#include "libpq-fe.h"
#include "access/xlogdefs.h"
extern const char *progname;
extern char *connection_string;
extern char *dbhost;
@@ -28,6 +30,15 @@ extern PGconn *conn;
extern PGconn *GetConnection(void);
/* Replication commands */
extern bool CreateReplicationSlot(PGconn *conn, const char *slot_name,
const char *plugin, XLogRecPtr *startpos,
bool is_physical);
extern bool DropReplicationSlot(PGconn *conn, const char *slot_name);
extern bool RunIdentifySystem(PGconn *conn, char **sysid,
TimeLineID *starttli,
XLogRecPtr *startpos,
char **db_name);
extern int64 feGetCurrentTimestamp(void);
extern void feTimestampDifference(int64 start_time, int64 stop_time,
long *secs, int *microsecs);