34 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
35 (
errmsg(
"must be superuser or replication role to use replication slots"))));
57 elog(
ERROR,
"return type must be a row type");
70 if (immediately_reserve)
117 elog(
ERROR,
"return type must be a row type");
151 memset(nulls, 0,
sizeof(nulls));
188 #define PG_GET_REPLICATION_SLOTS_COLS 11 199 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
200 errmsg(
"set-valued function called in context that cannot accept a set")));
203 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
204 errmsg(
"materialize mode required, but it is not " \
205 "allowed in this context")));
209 elog(
ERROR,
"return type must be a row type");
262 memset(nulls, 0,
sizeof(nulls));
280 values[i++] = database;
388 if (moveto <= ctx->reader->EndRecPtr)
457 (
errmsg(
"invalid target wal lsn")));
461 elog(
ERROR,
"return type must be a row type");
476 if (moveto < startlsn)
480 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
481 errmsg(
"cannot move slot to %X/%X, minimum is %X/%X",
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, Datum *values, bool *isnull)
int namecpy(Name n1, Name n2)
static const char * plugin
ReplicationSlotCtlData * ReplicationSlotCtl
void CheckSlotRequirements(void)
#define InvalidXLogRecPtr
#define IsA(nodeptr, _type_)
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
#define PG_GET_REPLICATION_SLOTS_COLS
Datum pg_get_replication_slots(PG_FUNCTION_ARGS)
int logical_read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr, int reqLen, XLogRecPtr targetRecPtr, char *cur_page, TimeLineID *pageTLI)
ResourceOwner CurrentResourceOwner
Datum pg_create_logical_replication_slot(PG_FUNCTION_ARGS)
void ReplicationSlotAcquire(const char *name, bool nowait)
#define tuplestore_donestoring(state)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
void ReplicationSlotCreate(const char *name, bool db_specific, ReplicationSlotPersistency persistency)
ReplicationSlotPersistency persistency
int errcode(int sqlerrcode)
void ReplicationSlotSave(void)
XLogRecPtr GetFlushRecPtr(void)
LogicalDecodingContext * CreateInitDecodingContext(char *plugin, List *output_plugin_options, bool need_full_snapshot, XLogPageReadCB read_page, LogicalOutputPluginWriterPrepareWrite prepare_write, LogicalOutputPluginWriterWrite do_write, LogicalOutputPluginWriterUpdateProgress update_progress)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
#define PG_GETARG_BOOL(n)
ReplicationSlotPersistentData data
bool RecoveryInProgress(void)
#define OidIsValid(objectId)
void InvalidateSystemCaches(void)
XLogRecord * XLogReadRecord(XLogReaderState *state, XLogRecPtr RecPtr, char **errormsg)
XLogRecPtr confirmed_flush
void LWLockRelease(LWLock *lock)
Datum pg_create_physical_replication_slot(PG_FUNCTION_ARGS)
#define SpinLockAcquire(lock)
void ReplicationSlotReserveWal(void)
void DecodingContextFindStartpoint(LogicalDecodingContext *ctx)
void ReplicationSlotsComputeRequiredLSN(void)
void LogicalDecodingProcessRecord(LogicalDecodingContext *ctx, XLogReaderState *record)
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)
void ReplicationSlotPersist(void)
Datum pg_replication_slot_advance(PG_FUNCTION_ARGS)
TransactionId catalog_xmin
#define InvalidTransactionId
void ReplicationSlotRelease(void)
static void check_permissions(void)
#define ereport(elevel, rest)
#define XLogRecPtrIsInvalid(r)
#define SpinLockRelease(lock)
Tuplestorestate * tuplestore_begin_heap(bool randomAccess, bool interXact, int maxKBytes)
#define TransactionIdGetDatum(X)
Datum pg_drop_replication_slot(PG_FUNCTION_ARGS)
#define PG_RETURN_DATUM(x)
LogicalDecodingContext * CreateDecodingContext(XLogRecPtr start_lsn, List *output_plugin_options, bool fast_forward, XLogPageReadCB read_page, LogicalOutputPluginWriterPrepareWrite prepare_write, LogicalOutputPluginWriterWrite do_write, LogicalOutputPluginWriterUpdateProgress update_progress)
TimeLineID ThisTimeLineID
SetFunctionReturnMode returnMode
ReplicationSlot * MyReplicationSlot
int max_replication_slots
#define Assert(condition)
void FreeDecodingContext(LogicalDecodingContext *ctx)
bool has_rolreplication(Oid roleid)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
#define HeapTupleGetDatum(tuple)
void LogicalConfirmReceivedLocation(XLogRecPtr lsn)
MemoryContext ecxt_per_query_memory
Tuplestorestate * setResult
static Datum values[MAXATTR]
void ReplicationSlotDrop(const char *name, bool nowait)
static XLogRecPtr pg_logical_replication_slot_advance(XLogRecPtr startlsn, XLogRecPtr moveto)
ReplicationSlotPersistency
int errmsg(const char *fmt,...)
#define CStringGetTextDatum(s)
#define CHECK_FOR_INTERRUPTS()
ReplicationSlot replication_slots[1]
static XLogRecPtr pg_physical_replication_slot_advance(XLogRecPtr startlsn, XLogRecPtr moveto)
void CheckLogicalDecodingRequirements(void)
void ReplicationSlotsComputeRequiredXmin(bool already_locked)
void ReplicationSlotMarkDirty(void)
#define PG_GETARG_NAME(n)
ResourceOwner ResourceOwnerCreate(ResourceOwner parent, const char *name)