PostgreSQL Source Code
git master
|
#include "access/htup.h"
#include "access/xlogreader.h"
#include "lib/stringinfo.h"
#include "storage/buf.h"
#include "storage/bufpage.h"
#include "storage/relfilelocator.h"
#include "utils/relcache.h"
Go to the source code of this file.
Data Structures | |
struct | xl_heap_delete |
struct | xl_heap_truncate |
struct | xl_heap_header |
struct | xl_heap_insert |
struct | xl_heap_multi_insert |
struct | xl_multi_insert_tuple |
struct | xl_heap_update |
struct | xl_heap_prune |
struct | xl_heap_vacuum |
struct | xl_heap_lock |
struct | xl_heap_lock_updated |
struct | xl_heap_confirm |
struct | xl_heap_inplace |
struct | xl_heap_freeze_plan |
struct | xl_heap_freeze_page |
struct | xl_heap_visible |
struct | xl_heap_new_cid |
struct | xl_heap_rewrite_mapping |
Typedefs | |
typedef struct xl_heap_delete | xl_heap_delete |
typedef struct xl_heap_truncate | xl_heap_truncate |
typedef struct xl_heap_header | xl_heap_header |
typedef struct xl_heap_insert | xl_heap_insert |
typedef struct xl_heap_multi_insert | xl_heap_multi_insert |
typedef struct xl_multi_insert_tuple | xl_multi_insert_tuple |
typedef struct xl_heap_update | xl_heap_update |
typedef struct xl_heap_prune | xl_heap_prune |
typedef struct xl_heap_vacuum | xl_heap_vacuum |
typedef struct xl_heap_lock | xl_heap_lock |
typedef struct xl_heap_lock_updated | xl_heap_lock_updated |
typedef struct xl_heap_confirm | xl_heap_confirm |
typedef struct xl_heap_inplace | xl_heap_inplace |
typedef struct xl_heap_freeze_plan | xl_heap_freeze_plan |
typedef struct xl_heap_freeze_page | xl_heap_freeze_page |
typedef struct xl_heap_visible | xl_heap_visible |
typedef struct xl_heap_new_cid | xl_heap_new_cid |
typedef struct xl_heap_rewrite_mapping | xl_heap_rewrite_mapping |
Functions | |
void | HeapTupleHeaderAdvanceConflictHorizon (HeapTupleHeader tuple, TransactionId *snapshotConflictHorizon) |
void | heap_redo (XLogReaderState *record) |
void | heap_desc (StringInfo buf, XLogReaderState *record) |
const char * | heap_identify (uint8 info) |
void | heap_mask (char *pagedata, BlockNumber blkno) |
void | heap2_redo (XLogReaderState *record) |
void | heap2_desc (StringInfo buf, XLogReaderState *record) |
const char * | heap2_identify (uint8 info) |
void | heap_xlog_logical_rewrite (XLogReaderState *r) |
XLogRecPtr | log_heap_visible (Relation rel, Buffer heap_buffer, Buffer vm_buffer, TransactionId snapshotConflictHorizon, uint8 vmflags) |
#define SizeOfHeapConfirm (offsetof(xl_heap_confirm, offnum) + sizeof(OffsetNumber)) |
Definition at line 307 of file heapam_xlog.h.
#define SizeOfHeapDelete (offsetof(xl_heap_delete, flags) + sizeof(uint8)) |
Definition at line 115 of file heapam_xlog.h.
#define SizeOfHeapFreezePage (offsetof(xl_heap_freeze_page, isCatalogRel) + sizeof(bool)) |
Definition at line 357 of file heapam_xlog.h.
#define SizeOfHeapHeader (offsetof(xl_heap_header, t_hoff) + sizeof(uint8)) |
Definition at line 151 of file heapam_xlog.h.
#define SizeOfHeapInplace (offsetof(xl_heap_inplace, offnum) + sizeof(OffsetNumber)) |
Definition at line 316 of file heapam_xlog.h.
#define SizeOfHeapInsert (offsetof(xl_heap_insert, flags) + sizeof(uint8)) |
Definition at line 162 of file heapam_xlog.h.
#define SizeOfHeapLock (offsetof(xl_heap_lock, flags) + sizeof(uint8)) |
Definition at line 288 of file heapam_xlog.h.
#define SizeOfHeapLockUpdated (offsetof(xl_heap_lock_updated, flags) + sizeof(uint8)) |
Definition at line 299 of file heapam_xlog.h.
#define SizeOfHeapMultiInsert offsetof(xl_heap_multi_insert, offsets) |
Definition at line 182 of file heapam_xlog.h.
#define SizeOfHeapNewCid (offsetof(xl_heap_new_cid, target_tid) + sizeof(ItemPointerData)) |
Definition at line 391 of file heapam_xlog.h.
#define SizeOfHeapPrune (offsetof(xl_heap_prune, isCatalogRel) + sizeof(bool)) |
Definition at line 253 of file heapam_xlog.h.
#define SizeOfHeapTruncate (offsetof(xl_heap_truncate, relids)) |
Definition at line 136 of file heapam_xlog.h.
#define SizeOfHeapUpdate (offsetof(xl_heap_update, new_offnum) + sizeof(OffsetNumber)) |
Definition at line 227 of file heapam_xlog.h.
#define SizeOfHeapVacuum (offsetof(xl_heap_vacuum, nunused) + sizeof(uint16)) |
Definition at line 267 of file heapam_xlog.h.
#define SizeOfHeapVisible (offsetof(xl_heap_visible, flags) + sizeof(uint8)) |
Definition at line 371 of file heapam_xlog.h.
#define SizeOfMultiInsertTuple (offsetof(xl_multi_insert_tuple, t_hoff) + sizeof(uint8)) |
Definition at line 193 of file heapam_xlog.h.
#define XLH_DELETE_ALL_VISIBLE_CLEARED (1<<0) |
Definition at line 96 of file heapam_xlog.h.
#define XLH_DELETE_CONTAINS_OLD (XLH_DELETE_CONTAINS_OLD_TUPLE | XLH_DELETE_CONTAINS_OLD_KEY) |
Definition at line 103 of file heapam_xlog.h.
#define XLH_DELETE_CONTAINS_OLD_KEY (1<<2) |
Definition at line 98 of file heapam_xlog.h.
#define XLH_DELETE_CONTAINS_OLD_TUPLE (1<<1) |
Definition at line 97 of file heapam_xlog.h.
#define XLH_DELETE_IS_PARTITION_MOVE (1<<4) |
Definition at line 100 of file heapam_xlog.h.
#define XLH_DELETE_IS_SUPER (1<<3) |
Definition at line 99 of file heapam_xlog.h.
#define XLH_FREEZE_XVAC 0x02 |
Definition at line 323 of file heapam_xlog.h.
#define XLH_INSERT_ALL_FROZEN_SET (1<<5) |
Definition at line 73 of file heapam_xlog.h.
#define XLH_INSERT_ALL_VISIBLE_CLEARED (1<<0) |
Definition at line 66 of file heapam_xlog.h.
#define XLH_INSERT_CONTAINS_NEW_TUPLE (1<<3) |
Definition at line 69 of file heapam_xlog.h.
#define XLH_INSERT_IS_SPECULATIVE (1<<2) |
Definition at line 68 of file heapam_xlog.h.
#define XLH_INSERT_LAST_IN_MULTI (1<<1) |
Definition at line 67 of file heapam_xlog.h.
#define XLH_INSERT_ON_TOAST_RELATION (1<<4) |
Definition at line 70 of file heapam_xlog.h.
#define XLH_INVALID_XVAC 0x04 |
Definition at line 324 of file heapam_xlog.h.
#define XLH_LOCK_ALL_FROZEN_CLEARED 0x01 |
Definition at line 277 of file heapam_xlog.h.
#define XLH_TRUNCATE_CASCADE (1<<0) |
Definition at line 120 of file heapam_xlog.h.
#define XLH_TRUNCATE_RESTART_SEQS (1<<1) |
Definition at line 121 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_NEW_TUPLE (1<<4) |
Definition at line 84 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_OLD (XLH_UPDATE_CONTAINS_OLD_TUPLE | XLH_UPDATE_CONTAINS_OLD_KEY) |
Definition at line 89 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_OLD_KEY (1<<3) |
Definition at line 83 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_OLD_TUPLE (1<<2) |
Definition at line 82 of file heapam_xlog.h.
#define XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED (1<<1) |
Definition at line 81 of file heapam_xlog.h.
#define XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED (1<<0) |
Definition at line 79 of file heapam_xlog.h.
#define XLH_UPDATE_PREFIX_FROM_OLD (1<<5) |
Definition at line 85 of file heapam_xlog.h.
#define XLH_UPDATE_SUFFIX_FROM_OLD (1<<6) |
Definition at line 86 of file heapam_xlog.h.
#define XLHL_KEYS_UPDATED 0x10 |
Definition at line 274 of file heapam_xlog.h.
#define XLHL_XMAX_EXCL_LOCK 0x04 |
Definition at line 272 of file heapam_xlog.h.
#define XLHL_XMAX_IS_MULTI 0x01 |
Definition at line 270 of file heapam_xlog.h.
#define XLHL_XMAX_KEYSHR_LOCK 0x08 |
Definition at line 273 of file heapam_xlog.h.
#define XLHL_XMAX_LOCK_ONLY 0x02 |
Definition at line 271 of file heapam_xlog.h.
#define XLOG_HEAP2_FREEZE_PAGE 0x30 |
Definition at line 56 of file heapam_xlog.h.
#define XLOG_HEAP2_LOCK_UPDATED 0x60 |
Definition at line 59 of file heapam_xlog.h.
#define XLOG_HEAP2_MULTI_INSERT 0x50 |
Definition at line 58 of file heapam_xlog.h.
#define XLOG_HEAP2_NEW_CID 0x70 |
Definition at line 60 of file heapam_xlog.h.
#define XLOG_HEAP2_PRUNE 0x10 |
Definition at line 54 of file heapam_xlog.h.
#define XLOG_HEAP2_REWRITE 0x00 |
Definition at line 53 of file heapam_xlog.h.
#define XLOG_HEAP2_VACUUM 0x20 |
Definition at line 55 of file heapam_xlog.h.
#define XLOG_HEAP2_VISIBLE 0x40 |
Definition at line 57 of file heapam_xlog.h.
#define XLOG_HEAP_CONFIRM 0x50 |
Definition at line 37 of file heapam_xlog.h.
#define XLOG_HEAP_DELETE 0x10 |
Definition at line 33 of file heapam_xlog.h.
#define XLOG_HEAP_HOT_UPDATE 0x40 |
Definition at line 36 of file heapam_xlog.h.
#define XLOG_HEAP_INIT_PAGE 0x80 |
Definition at line 46 of file heapam_xlog.h.
#define XLOG_HEAP_INPLACE 0x70 |
Definition at line 39 of file heapam_xlog.h.
#define XLOG_HEAP_INSERT 0x00 |
Definition at line 32 of file heapam_xlog.h.
#define XLOG_HEAP_LOCK 0x60 |
Definition at line 38 of file heapam_xlog.h.
#define XLOG_HEAP_OPMASK 0x70 |
Definition at line 41 of file heapam_xlog.h.
#define XLOG_HEAP_TRUNCATE 0x30 |
Definition at line 35 of file heapam_xlog.h.
#define XLOG_HEAP_UPDATE 0x20 |
Definition at line 34 of file heapam_xlog.h.
typedef struct xl_heap_confirm xl_heap_confirm |
typedef struct xl_heap_delete xl_heap_delete |
typedef struct xl_heap_freeze_page xl_heap_freeze_page |
typedef struct xl_heap_freeze_plan xl_heap_freeze_plan |
typedef struct xl_heap_header xl_heap_header |
typedef struct xl_heap_inplace xl_heap_inplace |
typedef struct xl_heap_insert xl_heap_insert |
typedef struct xl_heap_lock xl_heap_lock |
typedef struct xl_heap_lock_updated xl_heap_lock_updated |
typedef struct xl_heap_multi_insert xl_heap_multi_insert |
typedef struct xl_heap_new_cid xl_heap_new_cid |
typedef struct xl_heap_prune xl_heap_prune |
typedef struct xl_heap_rewrite_mapping xl_heap_rewrite_mapping |
typedef struct xl_heap_truncate xl_heap_truncate |
typedef struct xl_heap_update xl_heap_update |
typedef struct xl_heap_vacuum xl_heap_vacuum |
typedef struct xl_heap_visible xl_heap_visible |
typedef struct xl_multi_insert_tuple xl_multi_insert_tuple |
void heap2_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 172 of file heapdesc.c.
References appendStringInfo(), appendStringInfoString(), array_desc(), Assert(), buf, xl_heap_new_cid::cmax, xl_heap_new_cid::cmin, xl_heap_new_cid::combocid, RelFileLocator::dbOid, xl_heap_multi_insert::flags, xl_heap_lock_updated::flags, xl_heap_visible::flags, infobits_desc(), xl_heap_lock_updated::infobits_set, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), xl_heap_prune::ndead, xl_heap_freeze_page::nplans, xl_heap_prune::nredirected, xl_heap_multi_insert::ntuples, xl_heap_vacuum::nunused, xl_heap_lock_updated::offnum, offset_elem_desc(), xl_heap_multi_insert::offsets, plan_elem_desc(), redirect_elem_desc(), RelFileLocator::relNumber, xl_heap_prune::snapshotConflictHorizon, xl_heap_freeze_page::snapshotConflictHorizon, xl_heap_visible::snapshotConflictHorizon, RelFileLocator::spcOid, xl_heap_new_cid::target_locator, xl_heap_new_cid::target_tid, XLOG_HEAP2_FREEZE_PAGE, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE, XLOG_HEAP2_VACUUM, XLOG_HEAP2_VISIBLE, XLOG_HEAP_INIT_PAGE, XLOG_HEAP_OPMASK, XLogRecGetBlockData(), XLogRecGetData, XLogRecGetInfo, XLogRecHasBlockData, XLR_INFO_MASK, and xl_heap_lock_updated::xmax.
const char* heap2_identify | ( | uint8 | info | ) |
Definition at line 350 of file heapdesc.c.
References XLOG_HEAP2_FREEZE_PAGE, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE, XLOG_HEAP2_REWRITE, XLOG_HEAP2_VACUUM, XLOG_HEAP2_VISIBLE, XLOG_HEAP_INIT_PAGE, and XLR_INFO_MASK.
void heap2_redo | ( | XLogReaderState * | record | ) |
Definition at line 10018 of file heapam.c.
References elog(), heap_xlog_freeze_page(), heap_xlog_lock_updated(), heap_xlog_logical_rewrite(), heap_xlog_multi_insert(), heap_xlog_prune(), heap_xlog_vacuum(), heap_xlog_visible(), PANIC, XLOG_HEAP2_FREEZE_PAGE, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE, XLOG_HEAP2_REWRITE, XLOG_HEAP2_VACUUM, XLOG_HEAP2_VISIBLE, XLOG_HEAP_OPMASK, XLogRecGetInfo, and XLR_INFO_MASK.
void heap_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 95 of file heapdesc.c.
References appendStringInfo(), appendStringInfoString(), array_desc(), buf, xl_heap_delete::flags, xl_heap_truncate::flags, xl_heap_insert::flags, xl_heap_update::flags, xl_heap_lock::flags, infobits_desc(), xl_heap_delete::infobits_set, xl_heap_lock::infobits_set, xl_heap_update::new_offnum, xl_heap_update::new_xmax, xl_heap_truncate::nrelids, xl_heap_delete::offnum, xl_heap_insert::offnum, xl_heap_lock::offnum, xl_heap_confirm::offnum, xl_heap_inplace::offnum, oid_elem_desc(), xl_heap_update::old_infobits_set, xl_heap_update::old_offnum, xl_heap_update::old_xmax, xl_heap_truncate::relids, truncate_flags_desc(), XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_OPMASK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, XLogRecGetData, XLogRecGetInfo, XLR_INFO_MASK, xl_heap_delete::xmax, and xl_heap_lock::xmax.
const char* heap_identify | ( | uint8 | info | ) |
Definition at line 305 of file heapdesc.c.
References XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INIT_PAGE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, and XLR_INFO_MASK.
void heap_mask | ( | char * | pagedata, |
BlockNumber | blkno | ||
) |
Definition at line 10061 of file heapam.c.
References HEAP_XACT_MASK, HEAP_XMAX_COMMITTED, HEAP_XMAX_INVALID, HeapTupleHeaderIsSpeculative, HeapTupleHeaderXminFrozen, ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, ItemIdIsNormal, ItemPointerSet(), len, MASK_MARKER, mask_page_hint_bits(), mask_page_lsn_and_checksum(), mask_unused_space(), MAXALIGN, PageGetItemId(), PageGetMaxOffsetNumber(), and HeapTupleHeaderData::t_infomask.
void heap_redo | ( | XLogReaderState * | record | ) |
Definition at line 9972 of file heapam.c.
References elog(), heap_xlog_confirm(), heap_xlog_delete(), heap_xlog_inplace(), heap_xlog_insert(), heap_xlog_lock(), heap_xlog_update(), PANIC, XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_OPMASK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, XLogRecGetInfo, and XLR_INFO_MASK.
void heap_xlog_logical_rewrite | ( | XLogReaderState * | r | ) |
Definition at line 1107 of file rewriteheap.c.
References CloseTransientFile(), data, data_sync_elevel(), ereport, errcode_for_file_access(), errmsg(), ERROR, fd(), ftruncate, len, LOGICAL_REWRITE_FORMAT, LSN_FORMAT_ARGS, xl_heap_rewrite_mapping::mapped_db, xl_heap_rewrite_mapping::mapped_rel, xl_heap_rewrite_mapping::mapped_xid, MAXPGPATH, xl_heap_rewrite_mapping::num_mappings, xl_heap_rewrite_mapping::offset, OpenTransientFile(), PG_BINARY, pg_fsync(), pg_pwrite, pgstat_report_wait_end(), pgstat_report_wait_start(), snprintf, xl_heap_rewrite_mapping::start_lsn, XLogRecGetData, and XLogRecGetXid.
Referenced by heap2_redo().
void HeapTupleHeaderAdvanceConflictHorizon | ( | HeapTupleHeader | tuple, |
TransactionId * | snapshotConflictHorizon | ||
) |
Definition at line 7502 of file heapam.c.
References HEAP_MOVED, HeapTupleHeaderGetUpdateXid, HeapTupleHeaderGetXmin, HeapTupleHeaderGetXvac, HeapTupleHeaderXminCommitted, HeapTupleHeaderXminInvalid, HeapTupleHeaderData::t_infomask, TransactionIdDidCommit(), TransactionIdFollows(), and TransactionIdPrecedes().
Referenced by heap_index_delete_tuples(), and heap_prune_chain().
XLogRecPtr log_heap_visible | ( | Relation | rel, |
Buffer | heap_buffer, | ||
Buffer | vm_buffer, | ||
TransactionId | snapshotConflictHorizon, | ||
uint8 | vmflags | ||
) |
Definition at line 8334 of file heapam.c.
References Assert(), BufferIsValid(), xl_heap_visible::flags, REGBUF_NO_IMAGE, REGBUF_STANDARD, RelationIsAccessibleInLogicalDecoding, SizeOfHeapVisible, xl_heap_visible::snapshotConflictHorizon, VISIBILITYMAP_XLOG_CATALOG_REL, XLOG_HEAP2_VISIBLE, XLogBeginInsert(), XLogHintBitIsNeeded, XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by visibilitymap_set().