30#define DEFAULT_TABLE_ACCESS_METHOD "heap"
259#define TABLE_INSERT_SKIP_FSM 0x0002
260#define TABLE_INSERT_FROZEN 0x0004
261#define TABLE_INSERT_NO_LOGICAL 0x0008
265#define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS (1 << 0)
267#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION (1 << 1)
344 bool set_params,
bool allow_strat,
345 bool allow_sync,
bool allow_pagemode);
460 bool *call_again,
bool *all_dead);
635 double *tups_vacuumed,
636 double *tups_recently_dead);
701 void *callback_state,
902 bool allow_strat,
bool allow_sync)
940 bool allow_strat,
bool allow_sync,
1009 bool allow_strat,
bool allow_sync,
bool allow_pagemode)
1012 allow_strat, allow_sync,
1034 elog(
ERROR,
"unexpected table_scan_getnextslot call during logical decoding");
1210 bool *call_again,
bool *all_dead)
1218 elog(
ERROR,
"unexpected table_index_fetch_tuple call during logical decoding");
1264 elog(
ERROR,
"unexpected table_tuple_fetch_row_version call during logical decoding");
1392 bistate, specToken);
1401 uint32 specToken,
bool succeeded)
1462 snapshot, crosscheck,
1463 wait, tmfd, changingPart);
1508 cid, snapshot, crosscheck,
1510 lockmode, update_indexes);
1555 cid,
mode, wait_policy,
1597 persistence, freezeXid,
1654 double *tups_vacuumed,
1655 double *tups_recently_dead)
1658 use_sort, OldestXmin,
1659 xid_cutoff, multi_cutoff,
1660 num_tuples, tups_vacuumed,
1661 tups_recently_dead);
1708 double *liverows,
double *deadrows,
1750 void *callback_state,
1786 void *callback_state,
1891 sliceoffset, slicelength,
1946 elog(
ERROR,
"unexpected table_scan_bitmap_next_tuple call during logical decoding");
1974 elog(
ERROR,
"unexpected table_scan_sample_next_block call during logical decoding");
1997 elog(
ERROR,
"unexpected table_scan_sample_next_tuple call during logical decoding");
2045 Size overhead_bytes_per_tuple,
2046 Size usable_bytes_per_page);
#define InvalidBlockNumber
static Datum values[MAXATTR]
TransactionId MultiXactId
Assert(PointerIsAligned(start, uint64))
static PgChecksumMode mode
#define RelationGetRelid(relation)
struct TableScanDescData * TableScanDesc
const struct TableAmRoutine * rd_tableam
Size(* parallelscan_initialize)(Relation rel, ParallelTableScanDesc pscan)
void(* relation_copy_data)(Relation rel, const RelFileLocator *newrlocator)
void(* index_fetch_reset)(struct IndexFetchTableData *data)
TableScanDesc(* scan_begin)(Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key, ParallelTableScanDesc pscan, uint32 flags)
void(* tuple_complete_speculative)(Relation rel, TupleTableSlot *slot, uint32 specToken, bool succeeded)
void(* parallelscan_reinitialize)(Relation rel, ParallelTableScanDesc pscan)
bool(* scan_sample_next_tuple)(TableScanDesc scan, SampleScanState *scanstate, TupleTableSlot *slot)
bool(* scan_sample_next_block)(TableScanDesc scan, SampleScanState *scanstate)
void(* tuple_get_latest_tid)(TableScanDesc scan, ItemPointer tid)
void(* relation_copy_for_cluster)(Relation OldTable, Relation NewTable, Relation OldIndex, bool use_sort, TransactionId OldestXmin, TransactionId *xid_cutoff, MultiXactId *multi_cutoff, double *num_tuples, double *tups_vacuumed, double *tups_recently_dead)
bool(* scan_bitmap_next_tuple)(TableScanDesc scan, TupleTableSlot *slot, bool *recheck, uint64 *lossy_pages, uint64 *exact_pages)
bool(* scan_getnextslot_tidrange)(TableScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
void(* relation_estimate_size)(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac)
bool(* relation_needs_toast_table)(Relation rel)
bool(* tuple_tid_valid)(TableScanDesc scan, ItemPointer tid)
void(* scan_end)(TableScanDesc scan)
uint64(* relation_size)(Relation rel, ForkNumber forkNumber)
TM_Result(* tuple_lock)(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)
void(* relation_nontransactional_truncate)(Relation rel)
TM_Result(* tuple_update)(Relation rel, ItemPointer otid, TupleTableSlot *slot, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
bool(* tuple_fetch_row_version)(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot)
void(* relation_fetch_toast_slice)(Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result)
Oid(* relation_toast_am)(Relation rel)
bool(* scan_analyze_next_block)(TableScanDesc scan, ReadStream *stream)
Size(* parallelscan_estimate)(Relation rel)
void(* relation_set_new_filelocator)(Relation rel, const RelFileLocator *newrlocator, char persistence, TransactionId *freezeXid, MultiXactId *minmulti)
void(* scan_rescan)(TableScanDesc scan, ScanKeyData *key, bool set_params, bool allow_strat, bool allow_sync, bool allow_pagemode)
void(* scan_set_tidrange)(TableScanDesc scan, ItemPointer mintid, ItemPointer maxtid)
struct IndexFetchTableData *(* index_fetch_begin)(Relation rel)
void(* finish_bulk_insert)(Relation rel, int options)
bool(* scan_analyze_next_tuple)(TableScanDesc scan, TransactionId OldestXmin, double *liverows, double *deadrows, TupleTableSlot *slot)
TransactionId(* index_delete_tuples)(Relation rel, TM_IndexDeleteOp *delstate)
void(* index_fetch_end)(struct IndexFetchTableData *data)
void(* tuple_insert_speculative)(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate, uint32 specToken)
bool(* index_fetch_tuple)(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
TM_Result(* tuple_delete)(Relation rel, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
double(* index_build_range_scan)(Relation table_rel, Relation index_rel, IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
void(* relation_vacuum)(Relation rel, const VacuumParams params, BufferAccessStrategy bstrategy)
void(* multi_insert)(Relation rel, TupleTableSlot **slots, int nslots, CommandId cid, int options, BulkInsertStateData *bistate)
void(* index_validate_scan)(Relation table_rel, Relation index_rel, IndexInfo *index_info, Snapshot snapshot, ValidateIndexState *state)
bool(* scan_getnextslot)(TableScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
void(* tuple_insert)(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate)
bool(* tuple_satisfies_snapshot)(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
static void table_relation_fetch_toast_slice(Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result)
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
PGDLLIMPORT char * default_table_access_method
static void table_rescan_tidrange(TableScanDesc sscan, ItemPointer mintid, ItemPointer maxtid)
static double table_index_build_range_scan(Relation table_rel, Relation index_rel, IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
static void table_endscan(TableScanDesc scan)
static void table_multi_insert(Relation rel, TupleTableSlot **slots, int nslots, CommandId cid, int options, BulkInsertStateData *bistate)
void simple_table_tuple_update(Relation rel, ItemPointer otid, TupleTableSlot *slot, Snapshot snapshot, TU_UpdateIndexes *update_indexes)
static bool table_scan_analyze_next_tuple(TableScanDesc scan, TransactionId OldestXmin, double *liverows, double *deadrows, TupleTableSlot *slot)
bool table_index_fetch_tuple_check(Relation rel, ItemPointer tid, Snapshot snapshot, bool *all_dead)
PGDLLIMPORT bool synchronize_seqscans
Size table_block_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan)
TableScanDesc table_beginscan_parallel(Relation relation, ParallelTableScanDesc pscan)
struct TM_IndexDelete TM_IndexDelete
static void table_index_validate_scan(Relation table_rel, Relation index_rel, IndexInfo *index_info, Snapshot snapshot, ValidateIndexState *state)
static void table_relation_copy_for_cluster(Relation OldTable, Relation NewTable, Relation OldIndex, bool use_sort, TransactionId OldestXmin, TransactionId *xid_cutoff, MultiXactId *multi_cutoff, double *num_tuples, double *tups_vacuumed, double *tups_recently_dead)
static void table_index_fetch_reset(struct IndexFetchTableData *scan)
static uint64 table_relation_size(Relation rel, ForkNumber forkNumber)
static bool table_scan_sample_next_block(TableScanDesc scan, SampleScanState *scanstate)
static bool table_scan_bitmap_next_tuple(TableScanDesc scan, TupleTableSlot *slot, bool *recheck, uint64 *lossy_pages, uint64 *exact_pages)
static TM_Result table_tuple_lock(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)
void simple_table_tuple_insert(Relation rel, TupleTableSlot *slot)
static bool table_tuple_tid_valid(TableScanDesc scan, ItemPointer tid)
static IndexFetchTableData * table_index_fetch_begin(Relation rel)
static void table_rescan_set_params(TableScanDesc scan, ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
static TableScanDesc table_beginscan_sampling(Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
static void table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate, uint32 specToken)
void table_block_parallelscan_startblock_init(Relation rel, ParallelBlockTableScanWorker pbscanwork, ParallelBlockTableScanDesc pbscan)
static bool table_scan_analyze_next_block(TableScanDesc scan, ReadStream *stream)
static bool table_relation_needs_toast_table(Relation rel)
struct TM_IndexStatus TM_IndexStatus
static void table_tuple_complete_speculative(Relation rel, TupleTableSlot *slot, uint32 specToken, bool succeeded)
static TableScanDesc table_beginscan_tidrange(Relation rel, Snapshot snapshot, ItemPointer mintid, ItemPointer maxtid)
static TM_Result table_tuple_update(Relation rel, ItemPointer otid, TupleTableSlot *slot, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
static void table_index_fetch_end(struct IndexFetchTableData *scan)
static TableScanDesc table_beginscan_analyze(Relation rel)
const TableAmRoutine * GetTableAmRoutine(Oid amhandler)
static TM_Result table_tuple_delete(Relation rel, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
void table_tuple_get_latest_tid(TableScanDesc scan, ItemPointer tid)
static void table_rescan(TableScanDesc scan, ScanKeyData *key)
static bool table_index_fetch_tuple(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
static void table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate)
const TableAmRoutine * GetHeapamTableAmRoutine(void)
void simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
static void table_relation_vacuum(Relation rel, const VacuumParams params, BufferAccessStrategy bstrategy)
struct TM_FailureData TM_FailureData
static void table_finish_bulk_insert(Relation rel, int options)
void table_block_parallelscan_reinitialize(Relation rel, ParallelTableScanDesc pscan)
void(* IndexBuildCallback)(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state)
uint64 table_block_relation_size(Relation rel, ForkNumber forkNumber)
static void table_relation_set_new_filelocator(Relation rel, const RelFileLocator *newrlocator, char persistence, TransactionId *freezeXid, MultiXactId *minmulti)
static bool table_scan_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
static Oid table_relation_toast_am(Relation rel)
static bool table_scan_sample_next_tuple(TableScanDesc scan, SampleScanState *scanstate, TupleTableSlot *slot)
Size table_parallelscan_estimate(Relation rel, Snapshot snapshot)
static double table_index_build_scan(Relation table_rel, Relation index_rel, IndexInfo *index_info, bool allow_sync, bool progress, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
static void table_relation_copy_data(Relation rel, const RelFileLocator *newrlocator)
static TableScanDesc table_beginscan_bm(Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key)
static TableScanDesc table_beginscan_strat(Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key, bool allow_strat, bool allow_sync)
struct TM_IndexDeleteOp TM_IndexDeleteOp
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, ScanKeyData *key)
Size table_block_parallelscan_estimate(Relation rel)
static void table_relation_estimate_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac)
struct TableAmRoutine TableAmRoutine
static bool table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
static TableScanDesc table_beginscan(Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key)
static bool table_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
static TransactionId table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
static void table_relation_nontransactional_truncate(Relation rel)
void table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan, Snapshot snapshot)
static bool table_tuple_fetch_row_version(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot)
static void table_parallelscan_reinitialize(Relation rel, ParallelTableScanDesc pscan)
static TableScanDesc table_beginscan_tid(Relation rel, Snapshot snapshot)
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
BlockNumber table_block_parallelscan_nextpage(Relation rel, ParallelBlockTableScanWorker pbscanwork, ParallelBlockTableScanDesc pbscan)
void table_block_relation_estimate_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac, Size overhead_bytes_per_tuple, Size usable_bytes_per_page)
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
#define TransactionIdIsValid(xid)
TransactionId CheckXidAlive