75 elog(
ERROR,
"too much output for sql interface");
79 memset(nulls, 0,
sizeof(nulls));
125 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
126 errmsg(
"slot name must not be null")));
141 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
142 errmsg(
"options array must not be null")));
148 p->binary_output = binary;
158 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
159 errmsg(
"array must be one-dimensional")));
164 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
165 errmsg(
"array must not contain nulls")));
179 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
180 errmsg(
"array must have even number of elements")));
182 for (
i = 0;
i < nelems;
i += 2)
226 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
227 errmsg(
"logical decoding output plugin \"%s\" produces binary output, but function \"%s\" expects textual data",
231 ctx->output_writer_private = p;
244 while (ctx->reader->EndRecPtr < end_of_wal)
251 elog(
ERROR,
"could not find record for logical decoding: %s", errm);
262 upto_lsn <= ctx->reader->EndRecPtr)
264 if (upto_nchanges != 0 &&
265 upto_nchanges <= p->returned_rows)
#define PG_GETARG_ARRAYTYPE_P(n)
bool array_contains_nulls(ArrayType *array)
void deconstruct_array_builtin(ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
static Datum values[MAXATTR]
#define TextDatumGetCString(d)
elog(ERROR, "%s: %s", p2, msg)
void LogicalDecodingProcessRecord(LogicalDecodingContext *ctx, XLogReaderState *record)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#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)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * lappend(List *list, void *datum)
void LogicalConfirmReceivedLocation(XLogRecPtr lsn)
void FreeDecodingContext(LogicalDecodingContext *ctx)
void CheckLogicalDecodingRequirements(void)
LogicalDecodingContext * CreateDecodingContext(XLogRecPtr start_lsn, List *output_plugin_options, bool fast_forward, XLogReaderRoutine *xl_routine, LogicalOutputPluginWriterPrepareWrite prepare_write, LogicalOutputPluginWriterWrite do_write, LogicalOutputPluginWriterUpdateProgress update_progress)
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)
struct DecodingOutputState DecodingOutputState
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)
void * palloc0(Size size)
XLogRecPtr LogLogicalMessage(const char *prefix, const char *message, size_t size, bool transactional)
#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 ReplicationSlotMarkDirty(void)
void ReplicationSlotAcquire(const char *name, bool nowait)
ReplicationSlot * MyReplicationSlot
void CheckSlotPermissions(void)
void ReplicationSlotRelease(void)
void resetStringInfo(StringInfo str)
Tuplestorestate * tupstore
MemoryContext ecxt_per_query_memory
void * output_writer_private
ReplicationSlotPersistentData data
Tuplestorestate * setResult
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, Datum *values, bool *isnull)
String * makeString(char *str)
#define VARSIZE_ANY_EXHDR(PTR)
char * text_to_cstring(const text *t)
text * cstring_to_text_with_len(const char *s, int len)
bool RecoveryInProgress(void)
XLogRecPtr GetFlushRecPtr(TimeLineID *insertTLI)
#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)