1 /*-------------------------------------------------------------------------
5 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8 * src/bin/pg_basebackup/streamutil.h
9 *-------------------------------------------------------------------------
15 #include "access/xlogdefs.h"
16 #include "datatype/timestamp.h"
19 extern const char *progname
;
20 extern char *connection_string
;
25 extern int dbgetpassword
;
26 extern uint32 WalSegSz
;
28 /* Connection kept global so we can disconnect easily */
31 extern PGconn
*GetConnection(void);
33 /* Replication commands */
34 extern bool CreateReplicationSlot(PGconn
*conn
, const char *slot_name
,
35 const char *plugin
, bool is_temporary
,
36 bool is_physical
, bool reserve_wal
,
37 bool slot_exists_ok
, bool two_phase
);
38 extern bool DropReplicationSlot(PGconn
*conn
, const char *slot_name
);
39 extern bool RunIdentifySystem(PGconn
*conn
, char **sysid
,
43 extern bool RetrieveWalSegSize(PGconn
*conn
);
44 extern TimestampTz
feGetCurrentTimestamp(void);
45 extern void feTimestampDifference(TimestampTz start_time
, TimestampTz stop_time
,
46 long *secs
, int *microsecs
);
48 extern bool feTimestampDifferenceExceeds(TimestampTz start_time
, TimestampTz stop_time
,
50 extern void fe_sendint64(int64 i
, char *buf
);
51 extern int64
fe_recvint64(char *buf
);
53 #endif /* STREAMUTIL_H */