29#define DEFAULT_TABLE_ACCESS_METHOD "heap"
260#define TABLE_INSERT_SKIP_FSM 0x0002
261#define TABLE_INSERT_FROZEN 0x0004
262#define TABLE_INSERT_NO_LOGICAL 0x0008
266#define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS (1 << 0)
268#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION (1 << 1)
345 bool set_params,
bool allow_strat,
346 bool allow_sync,
bool allow_pagemode);
461 bool *call_again,
bool *all_dead);
636 double *tups_vacuumed,
637 double *tups_recently_dead);
702 void *callback_state,
903 bool allow_strat,
bool allow_sync)
944 bool allow_strat,
bool allow_sync,
1014 bool allow_strat,
bool allow_sync,
bool allow_pagemode)
1017 allow_strat, allow_sync,
1039 elog(
ERROR,
"unexpected table_scan_getnextslot call during logical decoding");
1215 bool *call_again,
bool *all_dead)
1223 elog(
ERROR,
"unexpected table_index_fetch_tuple call during logical decoding");
1269 elog(
ERROR,
"unexpected table_tuple_fetch_row_version call during logical decoding");
1397 bistate, specToken);
1406 uint32 specToken,
bool succeeded)
1466 snapshot, crosscheck,
1467 wait, tmfd, changingPart);
1511 cid, snapshot, crosscheck,
1513 lockmode, update_indexes);
1556 cid,
mode, wait_policy,
1598 persistence, freezeXid,
1655 double *tups_vacuumed,
1656 double *tups_recently_dead)
1659 use_sort, OldestXmin,
1660 xid_cutoff, multi_cutoff,
1661 num_tuples, tups_vacuumed,
1662 tups_recently_dead);
1709 double *liverows,
double *deadrows,
1751 void *callback_state,
1787 void *callback_state,
1892 sliceoffset, slicelength,
1947 elog(
ERROR,
"unexpected table_scan_bitmap_next_tuple call during logical decoding");
1975 elog(
ERROR,
"unexpected table_scan_sample_next_block call during logical decoding");
1998 elog(
ERROR,
"unexpected table_scan_sample_next_tuple call during logical decoding");
2046 Size overhead_bytes_per_tuple,
2047 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)
bool(* scan_sample_next_tuple)(TableScanDesc scan, struct SampleScanState *scanstate, TupleTableSlot *slot)
void(* index_fetch_reset)(struct IndexFetchTableData *data)
void(* tuple_complete_speculative)(Relation rel, TupleTableSlot *slot, uint32 specToken, bool succeeded)
void(* parallelscan_reinitialize)(Relation rel, ParallelTableScanDesc pscan)
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)
double(* index_build_range_scan)(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
TableScanDesc(* scan_begin)(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, ParallelTableScanDesc pscan, uint32 flags)
bool(* relation_needs_toast_table)(Relation rel)
bool(* tuple_tid_valid)(TableScanDesc scan, ItemPointer tid)
void(* multi_insert)(Relation rel, TupleTableSlot **slots, int nslots, CommandId cid, int options, struct BulkInsertStateData *bistate)
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)
bool(* scan_sample_next_block)(TableScanDesc scan, struct SampleScanState *scanstate)
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)
void(* tuple_insert)(Relation rel, TupleTableSlot *slot, CommandId cid, int options, struct BulkInsertStateData *bistate)
void(* scan_rescan)(TableScanDesc scan, struct ScanKeyData *key, bool set_params, bool allow_strat, bool allow_sync, bool allow_pagemode)
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)
void(* relation_vacuum)(Relation rel, struct VacuumParams *params, BufferAccessStrategy bstrategy)
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_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)
bool(* index_fetch_tuple)(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
void(* tuple_insert_speculative)(Relation rel, TupleTableSlot *slot, CommandId cid, int options, struct BulkInsertStateData *bistate, uint32 specToken)
TM_Result(* tuple_delete)(Relation rel, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
void(* index_validate_scan)(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, Snapshot snapshot, struct ValidateIndexState *state)
bool(* scan_getnextslot)(TableScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
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 TableScanDesc table_beginscan(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
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_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_bitmap_next_tuple(TableScanDesc scan, TupleTableSlot *slot, bool *recheck, uint64 *lossy_pages, uint64 *exact_pages)
static TableScanDesc table_beginscan_sampling(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
static void table_rescan(TableScanDesc scan, struct ScanKeyData *key)
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_index_validate_scan(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, Snapshot snapshot, struct ValidateIndexState *state)
static double table_index_build_range_scan(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
void table_block_parallelscan_startblock_init(Relation rel, ParallelBlockTableScanWorker pbscanwork, ParallelBlockTableScanDesc pbscan)
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, struct ScanKeyData *key)
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 TableScanDesc table_beginscan_strat(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool allow_strat, bool allow_sync)
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 bool table_index_fetch_tuple(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
static void table_rescan_set_params(TableScanDesc scan, struct ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
static void table_relation_vacuum(Relation rel, struct VacuumParams *params, BufferAccessStrategy bstrategy)
const TableAmRoutine * GetHeapamTableAmRoutine(void)
void simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
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 void table_multi_insert(Relation rel, TupleTableSlot **slots, int nslots, CommandId cid, int options, struct BulkInsertStateData *bistate)
static bool table_scan_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
static Oid table_relation_toast_am(Relation rel)
static void table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid, int options, struct BulkInsertStateData *bistate)
Size table_parallelscan_estimate(Relation rel, Snapshot snapshot)
static double table_index_build_scan(Relation table_rel, Relation index_rel, struct 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 bool table_scan_sample_next_block(TableScanDesc scan, struct SampleScanState *scanstate)
struct TM_IndexDeleteOp TM_IndexDeleteOp
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 void table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot, CommandId cid, int options, struct BulkInsertStateData *bistate, uint32 specToken)
static bool table_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
static TransactionId table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
static bool table_scan_sample_next_tuple(TableScanDesc scan, struct SampleScanState *scanstate, TupleTableSlot *slot)
static void table_relation_nontransactional_truncate(Relation rel)
void table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan, Snapshot snapshot)
static TableScanDesc table_beginscan_bm(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool need_tuple)
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