71 elog(
ERROR,
"too much output for sql interface");
75 memset(nulls, 0,
sizeof(nulls));
123 errmsg(
"slot name must not be null")));
139 errmsg(
"options array must not be null")));
156 errmsg(
"array must be one-dimensional")));
162 errmsg(
"array must not contain nulls")));
177 errmsg(
"array must have even number of elements")));
179 for (
i = 0;
i < nelems;
i += 2)
224 errmsg(
"logical decoding output plugin \"%s\" produces binary output, but function \"%s\" expects textual data",
259 elog(
ERROR,
"could not find record for logical decoding: %s",
errm);
380 transactional, flush);
#define PG_GETARG_ARRAYTYPE_P(n)
bool array_contains_nulls(const ArrayType *array)
void deconstruct_array_builtin(const ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
static Datum values[MAXATTR]
#define TextDatumGetCString(d)
#define PG_USED_FOR_ASSERTS_ONLY
#define Assert(condition)
void LogicalDecodingProcessRecord(LogicalDecodingContext *ctx, XLogReaderState *record)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc0_object(type)
#define PG_GETARG_BYTEA_PP(n)
#define PG_GETARG_TEXT_PP(n)
#define PG_GETARG_NAME(n)
#define PG_GETARG_INT32(n)
#define PG_GETARG_BOOL(n)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
void InvalidateSystemCaches(void)
List * lappend(List *list, void *datum)
void LogicalConfirmReceivedLocation(XLogRecPtr lsn)
void FreeDecodingContext(LogicalDecodingContext *ctx)
LogicalDecodingContext * CreateDecodingContext(XLogRecPtr start_lsn, List *output_plugin_options, bool fast_forward, XLogReaderRoutine *xl_routine, LogicalOutputPluginWriterPrepareWrite prepare_write, LogicalOutputPluginWriterWrite do_write, LogicalOutputPluginWriterUpdateProgress update_progress)
void CheckLogicalDecodingRequirements(void)
static void LogicalOutputPrepareWrite(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid, bool last_write)
Datum pg_logical_slot_get_changes(PG_FUNCTION_ARGS)
static void LogicalOutputWrite(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid, bool last_write)
Datum pg_logical_emit_message_bytea(PG_FUNCTION_ARGS)
Datum pg_logical_slot_get_binary_changes(PG_FUNCTION_ARGS)
Datum pg_logical_emit_message_text(PG_FUNCTION_ARGS)
Datum pg_logical_slot_peek_binary_changes(PG_FUNCTION_ARGS)
Datum pg_logical_slot_peek_changes(PG_FUNCTION_ARGS)
static Datum pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool binary)
DefElem * makeDefElem(char *name, Node *arg, int location)
int GetDatabaseEncoding(void)
bool pg_verify_mbstr(int encoding, const char *mbstr, int len, bool noError)
XLogRecPtr LogLogicalMessage(const char *prefix, const char *message, size_t size, bool transactional, bool flush)
#define CHECK_FOR_INTERRUPTS()
@ OUTPUT_PLUGIN_TEXTUAL_OUTPUT
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static Datum LSNGetDatum(XLogRecPtr X)
static Datum PointerGetDatum(const void *X)
static Datum TransactionIdGetDatum(TransactionId X)
char * format_procedure(Oid procedure_oid)
ResourceOwner CurrentResourceOwner
void ReplicationSlotAcquire(const char *name, bool nowait, bool error_if_invalid)
void ReplicationSlotMarkDirty(void)
ReplicationSlot * MyReplicationSlot
void CheckSlotPermissions(void)
void ReplicationSlotRelease(void)
void WaitForStandbyConfirmation(XLogRecPtr wait_for_lsn)
void resetStringInfo(StringInfo str)
Tuplestorestate * tupstore
OutputPluginOptions options
void * output_writer_private
OutputPluginOutputType output_type
ReplicationSlotPersistentData data
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)
String * makeString(char *str)
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
text * cstring_to_text_with_len(const char *s, int len)
char * text_to_cstring(const text *t)
bool RecoveryInProgress(void)
XLogRecPtr GetFlushRecPtr(TimeLineID *insertTLI)
#define XLogRecPtrIsValid(r)
#define InvalidXLogRecPtr
XLogRecord * XLogReadRecord(XLogReaderState *state, char **errormsg)
void XLogBeginRead(XLogReaderState *state, XLogRecPtr RecPtr)
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)
void wal_segment_close(XLogReaderState *state)
void wal_segment_open(XLogReaderState *state, XLogSegNo nextSegNo, TimeLineID *tli_p)
int read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr, int reqLen, XLogRecPtr targetRecPtr, char *cur_page)