PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xlogreader.h"
#include "access/xlogrecovery.h"
#include "access/xlogstats.h"
#include "access/xlogutils.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/pg_lsn.h"
Go to the source code of this file.
Macros | |
#define | PG_GET_WAL_BLOCK_INFO_COLS 20 |
#define | PG_GET_WAL_RECORD_INFO_COLS 11 |
#define | PG_GET_WAL_RECORDS_INFO_COLS 11 |
#define | PG_GET_WAL_STATS_COLS 9 |
Variables | |
PG_MODULE_MAGIC | |
#define PG_GET_WAL_BLOCK_INFO_COLS 20 |
#define PG_GET_WAL_RECORD_INFO_COLS 11 |
#define PG_GET_WAL_RECORDS_INFO_COLS 11 |
#define PG_GET_WAL_STATS_COLS 9 |
|
static |
Definition at line 604 of file pg_walinspect.c.
References Assert, CStringGetTextDatum, Float8GetDatum(), i, Int64GetDatum(), name, and values.
Referenced by GetXLogSummaryStats().
|
static |
Definition at line 69 of file pg_walinspect.c.
References Assert, GetFlushRecPtr(), GetXLogReplayRecPtr(), RecoveryInProgress(), and XLogRecPtrIsInvalid.
Referenced by pg_get_wal_record_info(), pg_get_wal_records_info_till_end_of_wal(), pg_get_wal_stats_till_end_of_wal(), and ValidateInputLSNs().
|
static |
Definition at line 249 of file pg_walinspect.c.
References DecodedBkpBlock::apply_image, Assert, DecodedBkpBlock::bimg_info, DecodedBkpBlock::bimg_len, BKPIMAGE_COMPRESS_LZ4, BKPIMAGE_COMPRESS_PGLZ, BKPIMAGE_COMPRESS_ZSTD, BKPIMAGE_HAS_HOLE, buf, construct_array_builtin(), CStringGetTextDatum, DecodedBkpBlock::data, DecodedBkpBlock::data_len, RelFileLocator::dbOid, XLogReaderState::EndRecPtr, ereport, errcode(), errmsg_internal(), ERROR, XLogReaderState::errormsg_buf, GetRmgr(), DecodedBkpBlock::has_data, DecodedBkpBlock::has_image, i, if(), initStringInfo(), Int16GetDatum(), Int64GetDatum(), LSNGetDatum(), ObjectIdGetDatum(), palloc(), palloc0(), PG_GET_WAL_BLOCK_INFO_COLS, pg_popcount(), PointerGetDatum(), psprintf(), XLogReaderState::ReadRecPtr, RelFileLocator::relNumber, RestoreBlockImage(), FunctionCallInfoBaseData::resultinfo, DecodedBkpBlock::rlocator, SET_VARSIZE, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, RelFileLocator::spcOid, TransactionIdGetDatum(), tuplestore_putvalues(), UInt32GetDatum(), values, VARDATA, VARHDRSZ, XLogRecGetBlock, XLogRecGetBlockTagExtended(), XLogRecGetDataLen, XLogRecGetInfo, XLogRecGetPrev, XLogRecGetRmid, XLogRecGetTotalLen, XLogRecGetXid, XLogRecHasAnyBlockRefs, XLogRecHasBlockRef, XLogRecMaxBlockId, and XLR_INFO_MASK.
Referenced by pg_get_wal_block_info().
|
static |
Definition at line 189 of file pg_walinspect.c.
References Assert, CStringGetTextDatum, StringInfoData::data, XLogReaderState::EndRecPtr, GetRmgr(), i, initStringInfo(), StringInfoData::len, LSNGetDatum(), psprintf(), XLogReaderState::ReadRecPtr, RmgrData::rm_desc, RmgrData::rm_identify, RmgrData::rm_name, TransactionIdGetDatum(), UInt32GetDatum(), values, XLogRecGetBlockRefInfo(), XLogRecGetDataLen, XLogRecGetInfo, XLogRecGetPrev, XLogRecGetRmid, XLogRecGetTotalLen, XLogRecGetXid, XLogRecHasAnyBlockRefs, and XLR_INFO_MASK.
Referenced by GetWALRecordsInfo(), and pg_get_wal_record_info().
|
static |
Definition at line 537 of file pg_walinspect.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, CHECK_FOR_INTERRUPTS, CurrentMemoryContext, XLogReaderState::EndRecPtr, GetWALRecordInfo(), InitMaterializedSRF(), InitXLogReaderState(), MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), pfree(), PG_GET_WAL_RECORDS_INFO_COLS, XLogReaderState::private_data, ReadNextXLogRecord(), FunctionCallInfoBaseData::resultinfo, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, tuplestore_putvalues(), values, xlogreader, and XLogReaderFree().
Referenced by pg_get_wal_records_info(), and pg_get_wal_records_info_till_end_of_wal().
|
static |
Definition at line 763 of file pg_walinspect.c.
References PG_GET_WAL_STATS_COLS, FunctionCallInfoBaseData::resultinfo, values, and xlogreader.
Referenced by pg_get_wal_stats(), and pg_get_wal_stats_till_end_of_wal().
|
static |
Definition at line 650 of file pg_walinspect.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, XLogRecStats::count, CurrentMemoryContext, FillXLogStatsRow(), XLogRecStats::fpi_len, GetRmgr(), MAX_XLINFO_TYPES, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), psprintf(), XLogRecStats::rec_len, XLogStats::record_stats, RmgrData::rm_identify, RM_MAX_ID, RmgrData::rm_name, XLogStats::rmgr_stats, RmgrIdExists(), RmgrIdIsValid, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, tuplestore_putvalues(), and values.
|
static |
Definition at line 91 of file pg_walinspect.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, LSN_FORMAT_ARGS, palloc0(), read_local_xlog_page_no_wait(), wal_segment_close(), wal_segment_open(), wal_segment_size, XL_ROUTINE, XLogFindNextRecord(), xlogreader, XLogReaderAllocate(), and XLogRecPtrIsInvalid.
Referenced by GetWALRecordsInfo(), pg_get_wal_block_info(), and pg_get_wal_record_info().
PG_FUNCTION_INFO_V1 | ( | pg_get_wal_block_info | ) |
PG_FUNCTION_INFO_V1 | ( | pg_get_wal_record_info | ) |
PG_FUNCTION_INFO_V1 | ( | pg_get_wal_records_info | ) |
PG_FUNCTION_INFO_V1 | ( | pg_get_wal_records_info_till_end_of_wal | ) |
PG_FUNCTION_INFO_V1 | ( | pg_get_wal_stats | ) |
PG_FUNCTION_INFO_V1 | ( | pg_get_wal_stats_till_end_of_wal | ) |
Datum pg_get_wal_block_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 412 of file pg_walinspect.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CHECK_FOR_INTERRUPTS, CurrentMemoryContext, XLogReaderState::EndRecPtr, GetWALBlockInfo(), InitMaterializedSRF(), InitXLogReaderState(), MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), pfree(), PG_GETARG_BOOL, PG_GETARG_LSN, PG_RETURN_VOID, XLogReaderState::private_data, ReadNextXLogRecord(), ValidateInputLSNs(), xlogreader, XLogReaderFree(), and XLogRecHasAnyBlockRefs.
Datum pg_get_wal_record_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 460 of file pg_walinspect.c.
References elog, XLogReaderState::EndRecPtr, ereport, errcode(), errdetail(), errmsg(), ERROR, get_call_result_type(), GetCurrentLSN(), GetWALRecordInfo(), heap_form_tuple(), HeapTupleGetDatum(), InitXLogReaderState(), LSN_FORMAT_ARGS, pfree(), PG_GET_WAL_RECORD_INFO_COLS, PG_GETARG_LSN, PG_RETURN_DATUM, XLogReaderState::private_data, ReadNextXLogRecord(), TYPEFUNC_COMPOSITE, values, xlogreader, and XLogReaderFree().
Datum pg_get_wal_records_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 589 of file pg_walinspect.c.
References GetWALRecordsInfo(), PG_GETARG_LSN, PG_RETURN_VOID, and ValidateInputLSNs().
Datum pg_get_wal_records_info_till_end_of_wal | ( | PG_FUNCTION_ARGS | ) |
Definition at line 818 of file pg_walinspect.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, GetCurrentLSN(), GetWALRecordsInfo(), LSN_FORMAT_ARGS, PG_GETARG_LSN, and PG_RETURN_VOID.
Datum pg_get_wal_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 801 of file pg_walinspect.c.
References GetWalStats(), PG_GETARG_BOOL, PG_GETARG_LSN, PG_RETURN_VOID, and ValidateInputLSNs().
Datum pg_get_wal_stats_till_end_of_wal | ( | PG_FUNCTION_ARGS | ) |
Definition at line 836 of file pg_walinspect.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, GetCurrentLSN(), GetWalStats(), LSN_FORMAT_ARGS, PG_GETARG_BOOL, PG_GETARG_LSN, and PG_RETURN_VOID.
|
static |
Definition at line 147 of file pg_walinspect.c.
References ReadLocalXLogPageNoWaitPrivate::end_of_wal, XLogReaderState::EndRecPtr, ereport, errcode_for_file_access(), errmsg(), ERROR, if(), LSN_FORMAT_ARGS, XLogReaderState::private_data, xlogreader, and XLogReadRecord().
Referenced by GetWALRecordsInfo(), pg_get_wal_block_info(), and pg_get_wal_record_info().
|
static |
Definition at line 513 of file pg_walinspect.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, GetCurrentLSN(), and LSN_FORMAT_ARGS.
Referenced by pg_get_wal_block_info(), pg_get_wal_records_info(), and pg_get_wal_stats().
PG_MODULE_MAGIC |
Definition at line 32 of file pg_walinspect.c.