PostgreSQL Source Code git master
Loading...
Searching...
No Matches
replorigindesc.c File Reference
#include "postgres.h"
#include "replication/origin.h"
Include dependency graph for replorigindesc.c:

Go to the source code of this file.

Functions

void replorigin_desc (StringInfo buf, XLogReaderState *record)
 
const charreplorigin_identify (uint8 info)
 

Function Documentation

◆ replorigin_desc()

void replorigin_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 19 of file replorigindesc.c.

20{
21 char *rec = XLogRecGetData(record);
22 uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
23
24 switch (info)
25 {
27 {
29
30 xlrec = (xl_replorigin_set *) rec;
31
32 appendStringInfo(buf, "set %u; lsn %X/%08X; force: %d",
33 xlrec->node_id,
34 LSN_FORMAT_ARGS(xlrec->remote_lsn),
35 xlrec->force);
36 break;
37 }
39 {
41
42 xlrec = (xl_replorigin_drop *) rec;
43
44 appendStringInfo(buf, "drop %u", xlrec->node_id);
45 break;
46 }
47 }
48}
uint8_t uint8
Definition c.h:544
#define XLOG_REPLORIGIN_DROP
Definition origin.h:31
#define XLOG_REPLORIGIN_SET
Definition origin.h:30
static char buf[DEFAULT_XLOG_SEG_SIZE]
static int fb(int x)
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition stringinfo.c:145
#define LSN_FORMAT_ARGS(lsn)
Definition xlogdefs.h:47
#define XLogRecGetInfo(decoder)
Definition xlogreader.h:409
#define XLogRecGetData(decoder)
Definition xlogreader.h:414

References appendStringInfo(), buf, fb(), LSN_FORMAT_ARGS, XLOG_REPLORIGIN_DROP, XLOG_REPLORIGIN_SET, XLogRecGetData, and XLogRecGetInfo.

◆ replorigin_identify()

const char * replorigin_identify ( uint8  info)

Definition at line 51 of file replorigindesc.c.

52{
53 switch (info)
54 {
56 return "SET";
58 return "DROP";
59 default:
60 return NULL;
61 }
62}

References fb(), XLOG_REPLORIGIN_DROP, and XLOG_REPLORIGIN_SET.