PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/heapam.h"
#include "access/htup_details.h"
#include "access/visibilitymap.h"
#include "access/xloginsert.h"
#include "catalog/pg_type.h"
#include "catalog/storage_xlog.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "storage/read_stream.h"
#include "storage/smgr.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | vbits |
struct | corrupt_items |
struct | collect_corrupt_items_read_stream_private |
Typedefs | |
typedef struct vbits | vbits |
typedef struct corrupt_items | corrupt_items |
Variables | |
PG_MODULE_MAGIC | |
typedef struct corrupt_items corrupt_items |
|
static |
Definition at line 935 of file pg_visibility.c.
References ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, RelationData::rd_rel, collect_corrupt_items_read_stream_private::rel, and RelationGetRelationName.
Referenced by collect_corrupt_items(), collect_visibility_data(), pg_truncate_visibility_map(), pg_visibility(), pg_visibility_map(), and pg_visibility_map_summary().
|
static |
Definition at line 708 of file pg_visibility.c.
References AccessShareLock, collect_corrupt_items_read_stream_private::all_frozen, collect_corrupt_items_read_stream_private::all_visible, BAS_BULKREAD, BUFFER_LOCK_SHARE, BufferGetBlockNumber(), BufferGetPage(), CHECK_FOR_INTERRUPTS, check_relation_relkind(), collect_corrupt_items_read_stream_next_block(), collect_corrupt_items_read_stream_private::current_blocknum, FirstOffsetNumber, GetAccessStrategy(), GetStrictOldestNonRemovableTransactionId(), heap_tuple_needs_eventual_freeze(), InvalidBuffer, InvalidTransactionId, ItemIdGetLength, ItemIdIsDead, ItemIdIsRedirected, ItemIdIsUsed, ItemPointerSet(), items, collect_corrupt_items_read_stream_private::last_exclusive, LockBuffer(), MAIN_FORKNUM, OffsetNumberNext, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), palloc(), palloc0(), read_stream_begin_relation(), read_stream_end(), READ_STREAM_FULL, read_stream_next_buffer(), record_corrupt_item(), collect_corrupt_items_read_stream_private::rel, relation_close(), relation_open(), RelationGetNumberOfBlocks, ReleaseBuffer(), HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, TransactionIdPrecedes(), tuple_all_visible(), UnlockReleaseBuffer(), VM_ALL_FROZEN, VM_ALL_VISIBLE, and collect_corrupt_items_read_stream_private::vmbuffer.
Referenced by pg_check_frozen(), and pg_check_visible().
|
static |
Definition at line 666 of file pg_visibility.c.
References collect_corrupt_items_read_stream_private::all_frozen, collect_corrupt_items_read_stream_private::all_visible, CHECK_FOR_INTERRUPTS, collect_corrupt_items_read_stream_private::current_blocknum, InvalidBlockNumber, collect_corrupt_items_read_stream_private::last_exclusive, collect_corrupt_items_read_stream_private::rel, VM_ALL_FROZEN, VM_ALL_VISIBLE, and collect_corrupt_items_read_stream_private::vmbuffer.
Referenced by collect_corrupt_items().
Definition at line 500 of file pg_visibility.c.
References AccessShareLock, Assert, BAS_BULKREAD, vbits::bits, block_range_read_stream_cb(), BUFFER_LOCK_SHARE, BufferGetPage(), CHECK_FOR_INTERRUPTS, check_relation_relkind(), vbits::count, BlockRangeReadStreamPrivate::current_blocknum, GetAccessStrategy(), InvalidBuffer, BlockRangeReadStreamPrivate::last_exclusive, LockBuffer(), MAIN_FORKNUM, vbits::next, PageIsAllVisible(), palloc0(), read_stream_begin_relation(), read_stream_end(), READ_STREAM_FULL, read_stream_next_buffer(), relation_close(), relation_open(), RelationGetNumberOfBlocks, ReleaseBuffer(), UnlockReleaseBuffer(), VISIBILITYMAP_ALL_FROZEN, VISIBILITYMAP_ALL_VISIBLE, and visibilitymap_get_status().
Referenced by pg_visibility_map_rel(), and pg_visibility_rel().
|
static |
Definition at line 617 of file pg_visibility.c.
References GetOldestNonRemovableTransactionId(), GetRunningTransactionData(), LW_SHARED, LWLockAcquire(), LWLockRelease(), TransamVariablesData::nextXid, RunningTransactionsData::oldestDatabaseRunningXid, RunningTransactionsData::oldestRunningXid, RelationData::rd_rel, RecoveryInProgress(), RELATION_IS_LOCAL, TransamVariables, and XidFromFullTransactionId.
Referenced by collect_corrupt_items().
Datum pg_check_frozen | ( | PG_FUNCTION_ARGS | ) |
Definition at line 321 of file pg_visibility.c.
References collect_corrupt_items(), if(), items, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, PG_GETARG_OID, PointerGetDatum(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, and FuncCallContext::user_fctx.
Datum pg_check_visible | ( | PG_FUNCTION_ARGS | ) |
Definition at line 353 of file pg_visibility.c.
References collect_corrupt_items(), if(), items, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, PG_GETARG_OID, PointerGetDatum(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, and FuncCallContext::user_fctx.
PG_FUNCTION_INFO_V1 | ( | pg_check_frozen | ) |
PG_FUNCTION_INFO_V1 | ( | pg_check_visible | ) |
PG_FUNCTION_INFO_V1 | ( | pg_truncate_visibility_map | ) |
PG_FUNCTION_INFO_V1 | ( | pg_visibility | ) |
PG_FUNCTION_INFO_V1 | ( | pg_visibility_map | ) |
PG_FUNCTION_INFO_V1 | ( | pg_visibility_map_rel | ) |
PG_FUNCTION_INFO_V1 | ( | pg_visibility_map_summary | ) |
PG_FUNCTION_INFO_V1 | ( | pg_visibility_rel | ) |
Datum pg_truncate_visibility_map | ( | PG_FUNCTION_ARGS | ) |
Definition at line 388 of file pg_visibility.c.
References AccessExclusiveLock, Assert, xl_smgr_truncate::blkno, BlockNumberIsValid(), check_relation_relkind(), DELAY_CHKPT_COMPLETE, DELAY_CHKPT_START, PGPROC::delayChkptFlags, END_CRIT_SECTION, xl_smgr_truncate::flags, InvalidBlockNumber, MyProc, PG_GETARG_OID, PG_RETURN_VOID, RelationData::rd_locator, relation_close(), relation_open(), RelationGetSmgr(), RelationNeedsWAL, xl_smgr_truncate::rlocator, SMgrRelationData::smgr_cached_nblocks, SMGR_TRUNCATE_VM, smgrnblocks(), smgrtruncate(), START_CRIT_SECTION, VISIBILITYMAP_FORKNUM, visibilitymap_prepare_truncate(), XLOG_SMGR_TRUNCATE, XLogBeginInsert(), XLogFlush(), XLogInsert(), XLogRegisterData(), and XLR_SPECIAL_REL_UPDATE.
Datum pg_visibility | ( | PG_FUNCTION_ARGS | ) |
Definition at line 120 of file pg_visibility.c.
References AccessShareLock, BoolGetDatum(), BUFFER_LOCK_SHARE, BufferGetPage(), check_relation_relkind(), ereport, errcode(), errmsg(), ERROR, heap_form_tuple(), HeapTupleGetDatum(), InvalidBuffer, LockBuffer(), MaxBlockNumber, PageIsAllVisible(), PG_GETARG_INT64, PG_GETARG_OID, PG_RETURN_DATUM, pg_visibility_tupdesc(), ReadBuffer(), relation_close(), relation_open(), RelationGetNumberOfBlocks, ReleaseBuffer(), UnlockReleaseBuffer(), values, VISIBILITYMAP_ALL_FROZEN, VISIBILITYMAP_ALL_VISIBLE, and visibilitymap_get_status().
Datum pg_visibility_map | ( | PG_FUNCTION_ARGS | ) |
Definition at line 81 of file pg_visibility.c.
References AccessShareLock, BoolGetDatum(), check_relation_relkind(), ereport, errcode(), errmsg(), ERROR, heap_form_tuple(), HeapTupleGetDatum(), InvalidBuffer, MaxBlockNumber, PG_GETARG_INT64, PG_GETARG_OID, PG_RETURN_DATUM, pg_visibility_tupdesc(), relation_close(), relation_open(), ReleaseBuffer(), values, VISIBILITYMAP_ALL_FROZEN, VISIBILITYMAP_ALL_VISIBLE, and visibilitymap_get_status().
Datum pg_visibility_map_rel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 177 of file pg_visibility.c.
References vbits::bits, BoolGetDatum(), collect_visibility_data(), vbits::count, heap_form_tuple(), HeapTupleGetDatum(), if(), Int64GetDatum(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, vbits::next, PG_GETARG_OID, pg_visibility_tupdesc(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, FuncCallContext::tuple_desc, FuncCallContext::user_fctx, and values.
Datum pg_visibility_map_summary | ( | PG_FUNCTION_ARGS | ) |
Definition at line 266 of file pg_visibility.c.
References AccessShareLock, CHECK_FOR_INTERRUPTS, check_relation_relkind(), elog, ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int64GetDatum(), InvalidBuffer, PG_GETARG_OID, PG_RETURN_DATUM, relation_close(), relation_open(), RelationGetNumberOfBlocks, ReleaseBuffer(), TYPEFUNC_COMPOSITE, values, VISIBILITYMAP_ALL_FROZEN, VISIBILITYMAP_ALL_VISIBLE, and visibilitymap_get_status().
Datum pg_visibility_rel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 221 of file pg_visibility.c.
References vbits::bits, BoolGetDatum(), collect_visibility_data(), vbits::count, heap_form_tuple(), HeapTupleGetDatum(), if(), Int64GetDatum(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, vbits::next, PG_GETARG_OID, pg_visibility_tupdesc(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, FuncCallContext::tuple_desc, FuncCallContext::user_fctx, and values.
|
static |
Definition at line 471 of file pg_visibility.c.
References a, Assert, BlessTupleDesc(), CreateTemplateTupleDesc(), and TupleDescInitEntry().
Referenced by pg_visibility(), pg_visibility_map(), pg_visibility_map_rel(), and pg_visibility_rel().
|
static |
Definition at line 889 of file pg_visibility.c.
References items, and repalloc().
Referenced by collect_corrupt_items().
|
static |
Definition at line 907 of file pg_visibility.c.
References HEAPTUPLE_LIVE, HeapTupleHeaderGetXmin, HeapTupleSatisfiesVacuum(), HeapTupleData::t_data, and TransactionIdPrecedes().
Referenced by collect_corrupt_items().
PG_MODULE_MAGIC |
Definition at line 28 of file pg_visibility.c.