1 /*-------------------------------------------------------------------------
4 * Exports from replication/walreceiverfuncs.c.
6 * Portions Copyright (c) 2010-2010, PostgreSQL Global Development Group
8 * $PostgreSQL: pgsql/src/include/replication/walreceiver.h,v 1.1 2010/01/15 09:19:09 heikki Exp $
10 *-------------------------------------------------------------------------
12 #ifndef _WALRECEIVER_H
13 #define _WALRECEIVER_H
15 #include "storage/spin.h"
18 * MAXCONNINFO: maximum size of a connection string.
20 * XXX: Should this move to pg_config_manual.h?
22 #define MAXCONNINFO 1024
25 * Values for WalRcv->walRcvState.
30 WALRCV_RUNNING, /* walreceiver has been started */
31 WALRCV_STOPPING, /* requested to stop, but still running */
32 WALRCV_STOPPED /* stopped and mustn't start up again */
35 /* Shared memory area for management of walreceiver process */
39 * connection string; is used for walreceiver to connect with
42 char conninfo[MAXCONNINFO];
45 * PID of currently active walreceiver process, and the current state.
48 WalRcvState walRcvState;
51 * receivedUpto-1 is the last byte position that has been already
52 * received. When startup process starts the walreceiver, it sets this
53 * to the point where it wants the streaming to begin. After that,
54 * walreceiver updates this whenever it flushes the received WAL.
56 XLogRecPtr receivedUpto;
58 slock_t mutex; /* locks shared variables shown above */
61 extern WalRcvData *WalRcv;
63 extern Size WalRcvShmemSize(void);
64 extern void WalRcvShmemInit(void);
65 extern bool WalRcvInProgress(void);
66 extern XLogRecPtr WaitNextXLogAvailable(XLogRecPtr recptr, bool *finished);
67 extern void RequestXLogStreaming(XLogRecPtr recptr, const char *conninfo);
68 extern XLogRecPtr GetWalRcvWriteRecPtr(void);
70 #endif /* _WALRECEIVER_H */