PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
message.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 * message.h
3 * Exports from replication/logical/message.c
4 *
5 * Copyright (c) 2013-2025, PostgreSQL Global Development Group
6 *
7 * src/include/replication/message.h
8 *-------------------------------------------------------------------------
9 */
10#ifndef PG_LOGICAL_MESSAGE_H
11#define PG_LOGICAL_MESSAGE_H
12
13#include "access/xlog.h"
14#include "access/xlogdefs.h"
15#include "access/xlogreader.h"
16
17/*
18 * Generic logical decoding message wal record.
19 */
20typedef struct xl_logical_message
21{
22 Oid dbId; /* database Oid emitted from */
23 bool transactional; /* is message transactional? */
24 Size prefix_size; /* length of prefix */
25 Size message_size; /* size of the message */
26 /* payload, including null-terminated prefix of length prefix_size */
29
30#define SizeOfLogicalMessage (offsetof(xl_logical_message, message))
31
32extern XLogRecPtr LogLogicalMessage(const char *prefix, const char *message,
33 size_t size, bool transactional,
34 bool flush);
35
36/* RMGR API */
37#define XLOG_LOGICAL_MESSAGE 0x00
38extern void logicalmsg_redo(XLogReaderState *record);
39extern void logicalmsg_desc(StringInfo buf, XLogReaderState *record);
40extern const char *logicalmsg_identify(uint8 info);
41
42#endif /* PG_LOGICAL_MESSAGE_H */
uint8_t uint8
Definition: c.h:500
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:434
size_t Size
Definition: c.h:576
XLogRecPtr LogLogicalMessage(const char *prefix, const char *message, size_t size, bool transactional, bool flush)
Definition: message.c:43
struct xl_logical_message xl_logical_message
const char * logicalmsg_identify(uint8 info)
void logicalmsg_desc(StringInfo buf, XLogReaderState *record)
void logicalmsg_redo(XLogReaderState *record)
Definition: message.c:87
static char * buf
Definition: pg_test_fsync.c:72
unsigned int Oid
Definition: postgres_ext.h:30
bool transactional
Definition: message.h:23
char message[FLEXIBLE_ARRAY_MEMBER]
Definition: message.h:27
uint64 XLogRecPtr
Definition: xlogdefs.h:21