PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | LogicalRepTupleData |
struct | LogicalRepRelation |
struct | LogicalRepTyp |
struct | LogicalRepBeginData |
struct | LogicalRepCommitData |
Macros | |
#define | LOGICALREP_PROTO_MIN_VERSION_NUM 1 |
#define | LOGICALREP_PROTO_VERSION_NUM 1 |
#define | LOGICALREP_PROTO_STREAM_VERSION_NUM 2 |
#define | LOGICALREP_PROTO_MAX_VERSION_NUM LOGICALREP_PROTO_STREAM_VERSION_NUM |
#define | LOGICALREP_COLUMN_NULL 'n' |
#define | LOGICALREP_COLUMN_UNCHANGED 'u' |
#define | LOGICALREP_COLUMN_TEXT 't' |
#define | LOGICALREP_COLUMN_BINARY 'b' /* added in PG14 */ |
Typedefs | |
typedef enum LogicalRepMsgType | LogicalRepMsgType |
typedef struct LogicalRepTupleData | LogicalRepTupleData |
typedef uint32 | LogicalRepRelId |
typedef struct LogicalRepRelation | LogicalRepRelation |
typedef struct LogicalRepTyp | LogicalRepTyp |
typedef struct LogicalRepBeginData | LogicalRepBeginData |
typedef struct LogicalRepCommitData | LogicalRepCommitData |
Enumerations | |
enum | LogicalRepMsgType { LOGICAL_REP_MSG_BEGIN = 'B', LOGICAL_REP_MSG_COMMIT = 'C', LOGICAL_REP_MSG_ORIGIN = 'O', LOGICAL_REP_MSG_INSERT = 'I', LOGICAL_REP_MSG_UPDATE = 'U', LOGICAL_REP_MSG_DELETE = 'D', LOGICAL_REP_MSG_TRUNCATE = 'T', LOGICAL_REP_MSG_RELATION = 'R', LOGICAL_REP_MSG_TYPE = 'Y', LOGICAL_REP_MSG_MESSAGE = 'M', LOGICAL_REP_MSG_STREAM_START = 'S', LOGICAL_REP_MSG_STREAM_END = 'E', LOGICAL_REP_MSG_STREAM_COMMIT = 'c', LOGICAL_REP_MSG_STREAM_ABORT = 'A' } |
#define LOGICALREP_COLUMN_BINARY 'b' /* added in PG14 */ |
Definition at line 83 of file logicalproto.h.
Referenced by logicalrep_read_tuple(), logicalrep_write_tuple(), slot_modify_data(), and slot_store_data().
#define LOGICALREP_COLUMN_NULL 'n' |
Definition at line 80 of file logicalproto.h.
Referenced by logicalrep_read_tuple(), and logicalrep_write_tuple().
#define LOGICALREP_COLUMN_TEXT 't' |
Definition at line 82 of file logicalproto.h.
Referenced by logicalrep_read_tuple(), logicalrep_write_tuple(), slot_modify_data(), and slot_store_data().
#define LOGICALREP_COLUMN_UNCHANGED 'u' |
Definition at line 81 of file logicalproto.h.
Referenced by apply_handle_update(), logicalrep_read_tuple(), logicalrep_write_tuple(), and slot_modify_data().
#define LOGICALREP_PROTO_MAX_VERSION_NUM LOGICALREP_PROTO_STREAM_VERSION_NUM |
Definition at line 34 of file logicalproto.h.
Referenced by pgoutput_startup().
#define LOGICALREP_PROTO_MIN_VERSION_NUM 1 |
Definition at line 31 of file logicalproto.h.
Referenced by pgoutput_startup().
#define LOGICALREP_PROTO_STREAM_VERSION_NUM 2 |
Definition at line 33 of file logicalproto.h.
Referenced by ApplyWorkerMain(), and pgoutput_startup().
#define LOGICALREP_PROTO_VERSION_NUM 1 |
Definition at line 32 of file logicalproto.h.
Referenced by ApplyWorkerMain().
typedef struct LogicalRepBeginData LogicalRepBeginData |
typedef struct LogicalRepCommitData LogicalRepCommitData |
typedef enum LogicalRepMsgType LogicalRepMsgType |
typedef struct LogicalRepRelation LogicalRepRelation |
typedef uint32 LogicalRepRelId |
Definition at line 85 of file logicalproto.h.
typedef struct LogicalRepTupleData LogicalRepTupleData |
typedef struct LogicalRepTyp LogicalRepTyp |
enum LogicalRepMsgType |
Definition at line 46 of file logicalproto.h.
void logicalrep_read_begin | ( | StringInfo | in, |
LogicalRepBeginData * | begin_data | ||
) |
Definition at line 60 of file proto.c.
References LogicalRepBeginData::committime, elog, ERROR, LogicalRepBeginData::final_lsn, InvalidXLogRecPtr, pq_getmsgint(), pq_getmsgint64(), and LogicalRepBeginData::xid.
Referenced by apply_handle_begin().
void logicalrep_read_commit | ( | StringInfo | in, |
LogicalRepCommitData * | commit_data | ||
) |
Definition at line 95 of file proto.c.
References LogicalRepCommitData::commit_lsn, LogicalRepCommitData::committime, elog, LogicalRepCommitData::end_lsn, ERROR, pq_getmsgbyte(), and pq_getmsgint64().
Referenced by apply_handle_commit().
LogicalRepRelId logicalrep_read_delete | ( | StringInfo | in, |
LogicalRepTupleData * | oldtup | ||
) |
Definition at line 290 of file proto.c.
References generate_unaccent_rules::action, elog, ERROR, logicalrep_read_tuple(), pq_getmsgbyte(), and pq_getmsgint().
Referenced by apply_handle_delete().
LogicalRepRelId logicalrep_read_insert | ( | StringInfo | in, |
LogicalRepTupleData * | newtup | ||
) |
Definition at line 164 of file proto.c.
References generate_unaccent_rules::action, elog, ERROR, logicalrep_read_tuple(), pq_getmsgbyte(), and pq_getmsgint().
Referenced by apply_handle_insert().
char* logicalrep_read_origin | ( | StringInfo | in, |
XLogRecPtr * | origin_lsn | ||
) |
Definition at line 129 of file proto.c.
References pq_getmsgint64(), pq_getmsgstring(), and pstrdup().
LogicalRepRelation* logicalrep_read_rel | ( | StringInfo | in | ) |
Definition at line 425 of file proto.c.
References logicalrep_read_attrs(), logicalrep_read_namespace(), LogicalRepRelation::nspname, palloc(), pq_getmsgbyte(), pq_getmsgint(), pq_getmsgstring(), pstrdup(), LogicalRepRelation::relname, LogicalRepRelation::remoteid, and LogicalRepRelation::replident.
Referenced by apply_handle_relation().
void logicalrep_read_stream_abort | ( | StringInfo | in, |
TransactionId * | xid, | ||
TransactionId * | subxid | ||
) |
Definition at line 894 of file proto.c.
References Assert, and pq_getmsgint().
Referenced by apply_handle_stream_abort().
TransactionId logicalrep_read_stream_commit | ( | StringInfo | out, |
LogicalRepCommitData * | commit_data | ||
) |
Definition at line 852 of file proto.c.
References LogicalRepCommitData::commit_lsn, LogicalRepCommitData::committime, elog, LogicalRepCommitData::end_lsn, ERROR, pq_getmsgbyte(), pq_getmsgint(), and pq_getmsgint64().
Referenced by apply_handle_stream_commit().
TransactionId logicalrep_read_stream_start | ( | StringInfo | in, |
bool * | first_segment | ||
) |
Definition at line 802 of file proto.c.
References Assert, pq_getmsgbyte(), and pq_getmsgint().
Referenced by apply_handle_stream_start().
List* logicalrep_read_truncate | ( | StringInfo | in, |
bool * | cascade, | ||
bool * | restart_seqs | ||
) |
Definition at line 344 of file proto.c.
References i, lappend_oid(), NIL, pq_getmsgint(), TRUNCATE_CASCADE, and TRUNCATE_RESTART_SEQS.
Referenced by apply_handle_truncate().
void logicalrep_read_typ | ( | StringInfo | out, |
LogicalRepTyp * | ltyp | ||
) |
Definition at line 481 of file proto.c.
References logicalrep_read_namespace(), LogicalRepTyp::nspname, pq_getmsgint(), pq_getmsgstring(), pstrdup(), LogicalRepTyp::remoteid, and LogicalRepTyp::typname.
Referenced by apply_handle_type().
LogicalRepRelId logicalrep_read_update | ( | StringInfo | in, |
bool * | has_oldtuple, | ||
LogicalRepTupleData * | oldtup, | ||
LogicalRepTupleData * | newtup | ||
) |
Definition at line 219 of file proto.c.
References generate_unaccent_rules::action, elog, ERROR, logicalrep_read_tuple(), pq_getmsgbyte(), and pq_getmsgint().
Referenced by apply_handle_update().
void logicalrep_write_begin | ( | StringInfo | out, |
ReorderBufferTXN * | txn | ||
) |
Definition at line 46 of file proto.c.
References ReorderBufferTXN::commit_time, ReorderBufferTXN::final_lsn, LOGICAL_REP_MSG_BEGIN, pq_sendbyte(), pq_sendint32(), pq_sendint64(), and ReorderBufferTXN::xid.
Referenced by pgoutput_begin_txn().
void logicalrep_write_commit | ( | StringInfo | out, |
ReorderBufferTXN * | txn, | ||
XLogRecPtr | commit_lsn | ||
) |
Definition at line 75 of file proto.c.
References ReorderBufferTXN::commit_time, ReorderBufferTXN::end_lsn, LOGICAL_REP_MSG_COMMIT, pq_sendbyte(), and pq_sendint64().
Referenced by pgoutput_commit_txn().
void logicalrep_write_delete | ( | StringInfo | out, |
TransactionId | xid, | ||
Relation | rel, | ||
HeapTuple | oldtuple, | ||
bool | binary | ||
) |
Definition at line 260 of file proto.c.
References Assert, LOGICAL_REP_MSG_DELETE, logicalrep_write_tuple(), pq_sendbyte(), pq_sendint32(), RelationData::rd_rel, RelationGetRelid, and TransactionIdIsValid.
Referenced by pgoutput_change().
void logicalrep_write_insert | ( | StringInfo | out, |
TransactionId | xid, | ||
Relation | rel, | ||
HeapTuple | newtuple, | ||
bool | binary | ||
) |
Definition at line 142 of file proto.c.
References LOGICAL_REP_MSG_INSERT, logicalrep_write_tuple(), pq_sendbyte(), pq_sendint32(), RelationGetRelid, and TransactionIdIsValid.
Referenced by pgoutput_change().
void logicalrep_write_message | ( | StringInfo | out, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
bool | transactional, | ||
const char * | prefix, | ||
Size | sz, | ||
const char * | message | ||
) |
Definition at line 369 of file proto.c.
References LOGICAL_REP_MSG_MESSAGE, MESSAGE_TRANSACTIONAL, pq_sendbyte(), pq_sendbytes(), pq_sendint32(), pq_sendint64(), pq_sendint8(), pq_sendstring(), and TransactionIdIsValid.
Referenced by pgoutput_message().
void logicalrep_write_origin | ( | StringInfo | out, |
const char * | origin, | ||
XLogRecPtr | origin_lsn | ||
) |
Definition at line 113 of file proto.c.
References LOGICAL_REP_MSG_ORIGIN, pq_sendbyte(), pq_sendint64(), and pq_sendstring().
Referenced by pgoutput_begin_txn(), and pgoutput_stream_start().
void logicalrep_write_rel | ( | StringInfo | out, |
TransactionId | xid, | ||
Relation | rel | ||
) |
Definition at line 396 of file proto.c.
References LOGICAL_REP_MSG_RELATION, logicalrep_write_attrs(), logicalrep_write_namespace(), pq_sendbyte(), pq_sendint32(), pq_sendstring(), RelationData::rd_rel, RelationGetNamespace, RelationGetRelationName, RelationGetRelid, relname, and TransactionIdIsValid.
Referenced by send_relation_and_attrs().
void logicalrep_write_stream_abort | ( | StringInfo | out, |
TransactionId | xid, | ||
TransactionId | subxid | ||
) |
Definition at line 878 of file proto.c.
References Assert, LOGICAL_REP_MSG_STREAM_ABORT, pq_sendbyte(), pq_sendint32(), and TransactionIdIsValid.
Referenced by pgoutput_stream_abort().
void logicalrep_write_stream_commit | ( | StringInfo | out, |
ReorderBufferTXN * | txn, | ||
XLogRecPtr | commit_lsn | ||
) |
Definition at line 827 of file proto.c.
References Assert, ReorderBufferTXN::commit_time, ReorderBufferTXN::end_lsn, LOGICAL_REP_MSG_STREAM_COMMIT, pq_sendbyte(), pq_sendint32(), pq_sendint64(), TransactionIdIsValid, and ReorderBufferTXN::xid.
Referenced by pgoutput_stream_commit().
void logicalrep_write_stream_start | ( | StringInfo | out, |
TransactionId | xid, | ||
bool | first_segment | ||
) |
Definition at line 784 of file proto.c.
References Assert, LOGICAL_REP_MSG_STREAM_START, pq_sendbyte(), pq_sendint32(), and TransactionIdIsValid.
Referenced by pgoutput_stream_start().
void logicalrep_write_stream_stop | ( | StringInfo | out | ) |
Definition at line 818 of file proto.c.
References LOGICAL_REP_MSG_STREAM_END, and pq_sendbyte().
Referenced by pgoutput_stream_stop().
void logicalrep_write_truncate | ( | StringInfo | out, |
TransactionId | xid, | ||
int | nrelids, | ||
Oid | relids[], | ||
bool | cascade, | ||
bool | restart_seqs | ||
) |
Definition at line 312 of file proto.c.
References i, LOGICAL_REP_MSG_TRUNCATE, pq_sendbyte(), pq_sendint32(), pq_sendint8(), TransactionIdIsValid, TRUNCATE_CASCADE, and TRUNCATE_RESTART_SEQS.
Referenced by pgoutput_truncate().
void logicalrep_write_typ | ( | StringInfo | out, |
TransactionId | xid, | ||
Oid | typoid | ||
) |
Definition at line 450 of file proto.c.
References elog, ERROR, getBaseType(), GETSTRUCT, HeapTupleIsValid, LOGICAL_REP_MSG_TYPE, logicalrep_write_namespace(), NameStr, ObjectIdGetDatum, pq_sendbyte(), pq_sendint32(), pq_sendstring(), ReleaseSysCache(), SearchSysCache1(), TransactionIdIsValid, and TYPEOID.
Referenced by send_relation_and_attrs().
void logicalrep_write_update | ( | StringInfo | out, |
TransactionId | xid, | ||
Relation | rel, | ||
HeapTuple | oldtuple, | ||
HeapTuple | newtuple, | ||
bool | binary | ||
) |
Definition at line 186 of file proto.c.
References Assert, LOGICAL_REP_MSG_UPDATE, logicalrep_write_tuple(), pq_sendbyte(), pq_sendint32(), RelationData::rd_rel, RelationGetRelid, and TransactionIdIsValid.
Referenced by pgoutput_change().