PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/xlog_internal.h"
#include "access/xlogrecovery.h"
#include "access/xlogutils.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "replication/decode.h"
#include "replication/logical.h"
#include "replication/slot.h"
#include "replication/slotsync.h"
#include "utils/builtins.h"
#include "utils/guc.h"
#include "utils/inval.h"
#include "utils/pg_lsn.h"
#include "utils/resowner.h"
Go to the source code of this file.
Macros | |
#define | PG_GET_REPLICATION_SLOTS_COLS 19 |
#define PG_GET_REPLICATION_SLOTS_COLS 19 |
|
static |
Definition at line 602 of file slotfuncs.c.
References Assert, ReplicationSlotPersistentData::catalog_xmin, CheckLogicalDecodingRequirements(), CheckSlotPermissions(), CheckSlotRequirements(), ReplicationSlotPersistentData::confirmed_flush, create_logical_replication_slot(), create_physical_replication_slot(), ReplicationSlot::data, ReplicationSlot::effective_catalog_xmin, ReplicationSlot::effective_xmin, elog, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), i, ReplicationSlot::in_use, LSNGetDatum(), LW_SHARED, LWLockAcquire(), LWLockRelease(), max_replication_slots, ReplicationSlot::mutex, MyReplicationSlot, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, ReplicationSlotPersistentData::persistency, PG_GETARG_BOOL, PG_GETARG_NAME, PG_NARGS, PG_RETURN_DATUM, plugin, ReplicationSlotPersistentData::plugin, ReplicationSlotCtlData::replication_slots, ReplicationSlotCtl, ReplicationSlotMarkDirty(), ReplicationSlotPersist(), ReplicationSlotRelease(), ReplicationSlotSave(), ReplicationSlotsComputeRequiredLSN(), ReplicationSlotsComputeRequiredXmin(), ReplicationSlotPersistentData::restart_lsn, RS_TEMPORARY, SlotIsLogical, SpinLockAcquire, SpinLockRelease, TYPEFUNC_COMPOSITE, values, wal_segment_size, XLByteToSeg, XLogGetLastRemovedSegno(), XLogRecPtrIsInvalid, and ReplicationSlotPersistentData::xmin.
Referenced by pg_copy_logical_replication_slot_a(), pg_copy_logical_replication_slot_b(), pg_copy_logical_replication_slot_c(), pg_copy_physical_replication_slot_a(), and pg_copy_physical_replication_slot_b().
|
static |
Definition at line 121 of file slotfuncs.c.
References Assert, CreateInitDecodingContext(), DecodingContextFindStartpoint(), FreeDecodingContext(), MyReplicationSlot, name, NIL, plugin, read_local_xlog_page(), ReplicationSlotCreate(), RS_EPHEMERAL, RS_TEMPORARY, two_phase, wal_segment_close(), wal_segment_open(), and XL_ROUTINE.
Referenced by copy_replication_slot(), and pg_create_logical_replication_slot().
|
static |
Definition at line 40 of file slotfuncs.c.
References Assert, ReplicationSlot::data, MyReplicationSlot, name, ReplicationSlotCreate(), ReplicationSlotMarkDirty(), ReplicationSlotReserveWal(), ReplicationSlotSave(), ReplicationSlotPersistentData::restart_lsn, RS_PERSISTENT, RS_TEMPORARY, and XLogRecPtrIsInvalid.
Referenced by copy_replication_slot(), and pg_create_physical_replication_slot().
Datum pg_copy_logical_replication_slot_a | ( | PG_FUNCTION_ARGS | ) |
Definition at line 833 of file slotfuncs.c.
References copy_replication_slot().
Datum pg_copy_logical_replication_slot_b | ( | PG_FUNCTION_ARGS | ) |
Definition at line 839 of file slotfuncs.c.
References copy_replication_slot().
Datum pg_copy_logical_replication_slot_c | ( | PG_FUNCTION_ARGS | ) |
Definition at line 845 of file slotfuncs.c.
References copy_replication_slot().
Datum pg_copy_physical_replication_slot_a | ( | PG_FUNCTION_ARGS | ) |
Definition at line 851 of file slotfuncs.c.
References copy_replication_slot().
Datum pg_copy_physical_replication_slot_b | ( | PG_FUNCTION_ARGS | ) |
Definition at line 857 of file slotfuncs.c.
References copy_replication_slot().
Datum pg_create_logical_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 173 of file slotfuncs.c.
References CheckLogicalDecodingRequirements(), CheckSlotPermissions(), ReplicationSlotPersistentData::confirmed_flush, create_logical_replication_slot(), ReplicationSlot::data, elog, ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), InvalidXLogRecPtr, LSNGetDatum(), MyReplicationSlot, name, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, PG_GETARG_BOOL, PG_GETARG_NAME, PG_RETURN_DATUM, plugin, ReplicationSlotPersist(), ReplicationSlotRelease(), two_phase, TYPEFUNC_COMPOSITE, and values.
Datum pg_create_physical_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 69 of file slotfuncs.c.
References CheckSlotPermissions(), CheckSlotRequirements(), create_physical_replication_slot(), ReplicationSlot::data, elog, ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), InvalidXLogRecPtr, LSNGetDatum(), MyReplicationSlot, name, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, PG_GETARG_BOOL, PG_GETARG_NAME, PG_RETURN_DATUM, ReplicationSlotRelease(), ReplicationSlotPersistentData::restart_lsn, TYPEFUNC_COMPOSITE, and values.
Datum pg_drop_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 222 of file slotfuncs.c.
References CheckSlotPermissions(), CheckSlotRequirements(), name, NameStr, PG_GETARG_NAME, PG_RETURN_VOID, and ReplicationSlotDrop().
Datum pg_get_replication_slots | ( | PG_FUNCTION_ARGS | ) |
Definition at line 240 of file slotfuncs.c.
References ReplicationSlot::active_pid, Assert, BoolGetDatum(), ReplicationSlotPersistentData::catalog_xmin, ReplicationSlotPersistentData::confirmed_flush, CStringGetTextDatum, ReplicationSlot::data, ReplicationSlotPersistentData::database, ReplicationSlotPersistentData::failover, GetWALAvailability(), GetXLogWriteRecPtr(), i, ReplicationSlot::in_use, ReplicationSlot::inactive_since, InitMaterializedSRF(), Int32GetDatum(), Int64GetDatum(), ReplicationSlotPersistentData::invalidated, InvalidOid, InvalidTransactionId, InvalidXLogRecPtr, LSNGetDatum(), LW_SHARED, LWLockAcquire(), LWLockRelease(), Max, max_replication_slots, max_slot_wal_keep_size_mb, ReplicationSlot::mutex, ReplicationSlotPersistentData::name, NameGetDatum(), ObjectIdGetDatum(), ReplicationSlotPersistentData::persistency, PG_GET_REPLICATION_SLOTS_COLS, ReplicationSlotPersistentData::plugin, ReplicationSlotCtlData::replication_slots, ReplicationSlotCtl, ReplicationSlotPersistentData::restart_lsn, RS_INVAL_HORIZON, RS_INVAL_NONE, RS_INVAL_WAL_LEVEL, RS_TEMPORARY, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, SlotInvalidationCauses, SlotIsPhysical, SpinLockAcquire, SpinLockRelease, ReplicationSlotPersistentData::synced, TimestampTzGetDatum(), TransactionIdGetDatum(), tuplestore_putvalues(), ReplicationSlotPersistentData::two_phase, values, wal_keep_size_mb, wal_segment_size, WALAVAIL_EXTENDED, WALAVAIL_INVALID_LSN, WALAVAIL_REMOVED, WALAVAIL_RESERVED, WALAVAIL_UNRESERVED, XLByteToSeg, XLogMBVarToSegs, XLogRecPtrIsInvalid, XLogSegNoOffsetToRecPtr, and ReplicationSlotPersistentData::xmin.
|
static |
Definition at line 499 of file slotfuncs.c.
References LogicalSlotAdvanceAndCheckSnapState().
Referenced by pg_replication_slot_advance().
|
static |
Definition at line 463 of file slotfuncs.c.
References Assert, ReplicationSlot::data, InvalidXLogRecPtr, ReplicationSlot::mutex, MyReplicationSlot, PhysicalWakeupLogicalWalSnd(), ReplicationSlotMarkDirty(), ReplicationSlotPersistentData::restart_lsn, SpinLockAcquire, and SpinLockRelease.
Referenced by pg_replication_slot_advance().
Datum pg_replication_slot_advance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 508 of file slotfuncs.c.
References Assert, CheckSlotPermissions(), ReplicationSlotPersistentData::confirmed_flush, ReplicationSlot::data, ReplicationSlotPersistentData::database, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, get_call_result_type(), GetFlushRecPtr(), GetXLogReplayRecPtr(), heap_form_tuple(), HeapTupleGetDatum(), LSN_FORMAT_ARGS, LSNGetDatum(), Min, MyReplicationSlot, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, OidIsValid, PG_GETARG_LSN, PG_GETARG_NAME, pg_logical_replication_slot_advance(), pg_physical_replication_slot_advance(), PG_RETURN_DATUM, RecoveryInProgress(), ReplicationSlotAcquire(), ReplicationSlotRelease(), ReplicationSlotsComputeRequiredLSN(), ReplicationSlotsComputeRequiredXmin(), ReplicationSlotPersistentData::restart_lsn, TYPEFUNC_COMPOSITE, values, and XLogRecPtrIsInvalid.
Datum pg_sync_replication_slots | ( | PG_FUNCTION_ARGS | ) |
Definition at line 867 of file slotfuncs.c.
References appendStringInfo(), appendStringInfoString(), CheckAndGetDbnameFromConninfo(), CheckSlotPermissions(), cluster_name, StringInfoData::data, ereport, err(), errcode(), errmsg(), ERROR, initStringInfo(), load_file(), pfree(), PG_RETURN_VOID, PrimaryConnInfo, RecoveryInProgress(), SyncReplicationSlots(), ValidateSlotSyncParams(), walrcv_connect, walrcv_disconnect, and wrconn.