116 bool *call_again,
bool *all_dead)
137 if (prev_buf != hscan->
xs_cbuf)
170 return got_heap_tuple;
244 bool shouldFree =
true;
264 bool shouldFree =
true;
284 uint32 specToken,
bool succeeded)
286 bool shouldFree =
true;
309 return heap_delete(relation, tid, cid, crosscheck, wait, tmfd, changingPart);
319 bool shouldFree =
true;
327 result =
heap_update(relation, otid, tuple, cid, crosscheck, wait,
367 follow_updates, &buffer, tmfd);
385 priorXmax = tmfd->
xmax;
401 errmsg(
"tuple to be locked was already moved to another partition due to concurrent update")));
404 if (
heap_fetch(relation, &SnapshotDirty, tuple, &buffer,
true))
427 errmsg_internal(
"t_xmin %u is uncommitted in tuple (%u,%u) to be updated in table \"%s\"",
455 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
456 errmsg(
"could not obtain lock on row in relation \"%s\"",
478 tmfd->
xmax = priorXmax;
493 goto tuple_lock_retry;
501 if (tuple->
t_data == NULL)
605 if (persistence == RELPERSISTENCE_UNLOGGED)
608 rel->
rd_rel->relkind == RELKIND_MATVIEW ||
609 rel->
rd_rel->relkind == RELKIND_TOASTVALUE);
650 rel->
rd_rel->relpersistence);
665 (rel->
rd_rel->relpersistence == RELPERSISTENCE_UNLOGGED &&
669 rel->
rd_rel->relpersistence);
686 double *tups_vacuumed,
687 double *tups_recently_dead)
693 bool is_system_catalog;
714 natts = newTupDesc->
natts;
716 isnull = (
bool *)
palloc(natts *
sizeof(
bool));
736 if (OldIndex != NULL && !use_sort)
738 const int ci_index[] = {
786 if (indexScan != NULL)
793 elog(
ERROR,
"CLUSTER does not support lossy index conditions");
844 *tups_recently_dead += 1;
860 if (!is_system_catalog &&
862 elog(
WARNING,
"concurrent insert in progress within table \"%s\"",
872 if (!is_system_catalog &&
874 elog(
WARNING,
"concurrent delete in progress within table \"%s\"",
877 *tups_recently_dead += 1;
881 elog(
ERROR,
"unexpected HeapTupleSatisfiesVacuum result");
896 *tups_recently_dead -= 1;
902 if (tuplesort != NULL)
915 const int ct_index[] = {
928 ct_val[0] = *num_tuples;
929 ct_val[1] = *num_tuples;
934 if (indexScan != NULL)
936 if (tableScan != NULL)
945 if (tuplesort != NULL)
1017 double *liverows,
double *deadrows,
1036 bool sample_it =
false;
1134 elog(
ERROR,
"unexpected HeapTupleSatisfiesVacuum result");
1168 void *callback_state,
1172 bool is_system_catalog;
1173 bool checking_uniqueness;
1183 bool need_unregister_snapshot =
false;
1198 checking_uniqueness = (indexInfo->
ii_Unique ||
1205 Assert(!(anyvisible && checking_uniqueness));
1245 need_unregister_snapshot =
true;
1309 Assert(start_blockno == 0);
1329 if (blocks_done != previous_blkno)
1333 previous_blkno = blocks_done;
1408 tupleIsAlive =
false;
1413 tupleIsAlive =
true;
1442 tupleIsAlive =
false;
1453 tupleIsAlive =
true;
1469 if (!is_system_catalog)
1470 elog(
WARNING,
"concurrent insert in progress within table \"%s\"",
1479 if (checking_uniqueness)
1508 tupleIsAlive =
true;
1520 tupleIsAlive =
false;
1528 if (!is_system_catalog)
1529 elog(
WARNING,
"concurrent delete in progress within table \"%s\"",
1546 if (checking_uniqueness ||
1597 tupleIsAlive =
false;
1600 elog(
ERROR,
"unexpected HeapTupleSatisfiesVacuum result");
1601 indexIt = tupleIsAlive =
false;
1613 tupleIsAlive =
true;
1626 if (predicate != NULL)
1628 if (!
ExecQual(predicate, econtext))
1677 errmsg_internal(
"failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
1683 root_offsets[offnum - 1]);
1693 tupleIsAlive, callback_state);
1719 if (need_unregister_snapshot)
1757 bool tuplesort_empty =
false;
1839 memset(in_index, 0,
sizeof(in_index));
1845 rootTuple = *heapcursor;
1850 root_offnum = root_offsets[root_offnum - 1];
1854 errmsg_internal(
"failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
1865 while (!tuplesort_empty &&
1882 &ts_val, &ts_isnull, NULL);
1883 Assert(tuplesort_empty || !ts_isnull);
1884 if (!tuplesort_empty)
1887 indexcursor = &decoded;
1890 #ifndef USE_FLOAT8_BYVAL
1905 if ((tuplesort_empty ||
1907 !in_index[root_offnum - 1])
1918 if (predicate != NULL)
1920 if (!
ExecQual(predicate, econtext))
1963 state->tups_inserted += 1;
2004 blocks_done = hscan->
rs_cblock - startblock;
2010 blocks_done = nblocks - startblock +
2032 int32 data_length = 0;
2033 bool maxlength_unknown =
false;
2034 bool has_toastable_attrs =
false;
2039 for (
i = 0;
i < tupdesc->
natts;
i++)
2043 if (att->attisdropped)
2046 if (att->attlen > 0)
2049 data_length += att->attlen;
2057 maxlength_unknown =
true;
2059 data_length += maxlen;
2060 if (att->attstorage != TYPSTORAGE_PLAIN)
2061 has_toastable_attrs =
true;
2064 if (!has_toastable_attrs)
2066 if (maxlength_unknown)
2080 return rel->
rd_rel->relam;
2089 #define HEAP_OVERHEAD_BYTES_PER_TUPLE \
2090 (MAXALIGN(SizeofHeapTupleHeader) + sizeof(ItemIdData))
2091 #define HEAP_USABLE_BYTES_PER_PAGE \
2092 (BLCKSZ - SizeOfPageHeaderData)
2169 for (curslot = 0; curslot < tbmres->
ntuples; curslot++)
2177 &heapTuple, NULL,
true))
2469 for (
i = 0;
i < newTupDesc->
natts;
i++)
2507 while (start <= end)
2509 int mid = (start + end) / 2;
2512 if (tupoffset == curoffset)
2514 else if (tupoffset < curoffset)
void pgstat_progress_update_param(int index, int64 val)
void pgstat_progress_update_multi_param(int nparam, const int *index, const int64 *val)
#define InvalidBlockNumber
#define BlockNumberIsValid(blockNumber)
static Datum values[MAXATTR]
Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, BlockNumber blockNum)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
void FlushRelationBuffers(Relation rel)
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
#define BUFFER_LOCK_UNLOCK
#define BUFFER_LOCK_SHARE
#define BufferIsValid(bufnum)
#define BufferGetPage(buffer)
#define PageIsAllVisible(page)
#define PageGetMaxOffsetNumber(page)
#define PageGetItemId(page, offsetNumber)
#define PageGetItem(page, itemId)
TransactionId MultiXactId
#define OidIsValid(objectId)
bool IsSystemRelation(Relation relation)
CommandId HeapTupleHeaderGetCmin(HeapTupleHeader tup)
static void PGresult * res
int errmsg_internal(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
ExprState * ExecPrepareQual(List *qual, EState *estate)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
TupleTableSlot * ExecStoreBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
const TupleTableSlotOps TTSOpsBufferHeapTuple
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
TupleTableSlot * ExecStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
const TupleTableSlotOps TTSOpsHeapTuple
TupleTableSlot * ExecStorePinnedBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
EState * CreateExecutorState(void)
void FreeExecutorState(EState *estate)
#define GetPerTupleExprContext(estate)
static bool ExecQual(ExprState *state, ExprContext *econtext)
#define PG_RETURN_POINTER(x)
void heap_finish_speculative(Relation relation, ItemPointer tid)
void heap_insert(Relation relation, HeapTuple tup, CommandId cid, int options, BulkInsertState bistate)
bool heap_fetch(Relation relation, Snapshot snapshot, HeapTuple tuple, Buffer *userbuf, bool keep_buf)
TM_Result heap_update(Relation relation, ItemPointer otid, HeapTuple newtup, CommandId cid, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode)
TM_Result heap_delete(Relation relation, ItemPointer tid, CommandId cid, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
bool heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
void heap_endscan(TableScanDesc sscan)
void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params, bool allow_strat, bool allow_sync, bool allow_pagemode)
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
bool heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, Snapshot snapshot, HeapTuple heapTuple, bool *all_dead, bool first_call)
bool heap_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid, ItemPointer maxtid)
void heap_abort_speculative(Relation relation, ItemPointer tid)
TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot, int nkeys, ScanKey key, ParallelTableScanDesc parallel_scan, uint32 flags)
void heapgetpage(TableScanDesc sscan, BlockNumber page)
TransactionId heap_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
void heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples, CommandId cid, int options, BulkInsertState bistate)
TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, bool follow_updates, Buffer *buffer, TM_FailureData *tmfd)
void heap_get_latest_tid(TableScanDesc sscan, ItemPointer tid)
void heap_setscanlimits(TableScanDesc sscan, BlockNumber startBlk, BlockNumber numBlks)
void HeapCheckForSerializableConflictOut(bool visible, Relation relation, HeapTuple tuple, Buffer buffer, Snapshot snapshot)
#define HEAP_INSERT_SPECULATIVE
struct HeapScanDescData * HeapScanDesc
@ HEAPTUPLE_RECENTLY_DEAD
@ HEAPTUPLE_INSERT_IN_PROGRESS
@ HEAPTUPLE_DELETE_IN_PROGRESS
static bool heapam_scan_analyze_next_block(TableScanDesc scan, BlockNumber blockno, BufferAccessStrategy bstrategy)
static double heapam_index_build_range_scan(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
static TM_Result heapam_tuple_update(Relation relation, ItemPointer otid, TupleTableSlot *slot, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, bool *update_indexes)
#define HEAP_OVERHEAD_BYTES_PER_TUPLE
static void heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode)
static void heapam_estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac)
static IndexFetchTableData * heapam_index_fetch_begin(Relation rel)
static const TableAmRoutine heapam_methods
static void heapam_index_validate_scan(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, Snapshot snapshot, ValidateIndexState *state)
static bool heapam_index_fetch_tuple(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
static void heapam_relation_copy_for_cluster(Relation OldHeap, Relation NewHeap, 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 heapam_tuple_insert_speculative(Relation relation, TupleTableSlot *slot, CommandId cid, int options, BulkInsertState bistate, uint32 specToken)
static bool heapam_scan_sample_next_block(TableScanDesc scan, SampleScanState *scanstate)
static void heapam_tuple_insert(Relation relation, TupleTableSlot *slot, CommandId cid, int options, BulkInsertState bistate)
static TM_Result heapam_tuple_delete(Relation relation, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
static void heapam_index_fetch_reset(IndexFetchTableData *scan)
static Oid heapam_relation_toast_am(Relation rel)
static bool heapam_relation_needs_toast_table(Relation rel)
static BlockNumber heapam_scan_get_blocks_done(HeapScanDesc hscan)
static bool heapam_scan_bitmap_next_block(TableScanDesc scan, TBMIterateResult *tbmres)
const TableAmRoutine * GetHeapamTableAmRoutine(void)
static bool heapam_scan_analyze_next_tuple(TableScanDesc scan, TransactionId OldestXmin, double *liverows, double *deadrows, TupleTableSlot *slot)
static bool SampleHeapTupleVisible(TableScanDesc scan, Buffer buffer, HeapTuple tuple, OffsetNumber tupoffset)
static void heapam_relation_set_new_filenode(Relation rel, const RelFileNode *newrnode, char persistence, TransactionId *freezeXid, MultiXactId *minmulti)
static bool heapam_scan_sample_next_tuple(TableScanDesc scan, SampleScanState *scanstate, TupleTableSlot *slot)
static const TupleTableSlotOps * heapam_slot_callbacks(Relation relation)
static bool heapam_tuple_tid_valid(TableScanDesc scan, ItemPointer tid)
#define HEAP_USABLE_BYTES_PER_PAGE
static TM_Result heapam_tuple_lock(Relation relation, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)
static void heapam_index_fetch_end(IndexFetchTableData *scan)
static void heapam_tuple_complete_speculative(Relation relation, TupleTableSlot *slot, uint32 specToken, bool succeeded)
static void reform_and_rewrite_tuple(HeapTuple tuple, Relation OldHeap, Relation NewHeap, Datum *values, bool *isnull, RewriteState rwstate)
static bool heapam_fetch_row_version(Relation relation, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot)
static bool heapam_scan_bitmap_next_tuple(TableScanDesc scan, TBMIterateResult *tbmres, TupleTableSlot *slot)
static void heapam_relation_nontransactional_truncate(Relation rel)
static bool heapam_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
Datum heap_tableam_handler(PG_FUNCTION_ARGS)
bool HeapTupleSatisfiesVisibility(HeapTuple tup, Snapshot snapshot, Buffer buffer)
HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin, Buffer buffer)
void heap_fetch_toast_slice(Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result)
#define TOAST_TUPLE_THRESHOLD
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
void heap_freetuple(HeapTuple htup)
HeapTupleHeaderData * HeapTupleHeader
#define HeapTupleHeaderSetSpeculativeToken(tup, token)
#define SizeofHeapTupleHeader
#define HeapTupleHeaderGetXmin(tup)
#define HeapTupleIsHeapOnly(tuple)
#define HeapTupleIsHotUpdated(tuple)
#define MaxHeapTuplesPerPage
#define HeapTupleHeaderGetUpdateXid(tup)
#define HeapTupleHeaderIsSpeculative(tup)
void FormIndexDatum(IndexInfo *indexInfo, TupleTableSlot *slot, EState *estate, Datum *values, bool *isnull)
static void itemptr_decode(ItemPointer itemptr, int64 encoded)
bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
bool index_insert(Relation indexRelation, Datum *values, bool *isnull, ItemPointer heap_t_ctid, Relation heapRelation, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo)
IndexScanDesc index_beginscan(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, int norderbys)
void index_endscan(IndexScanDesc scan)
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
#define ItemIdGetLength(itemId)
#define ItemIdIsNormal(itemId)
#define ItemIdIsDead(itemId)
int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2)
bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2)
#define ItemPointerGetBlockNumber(pointer)
#define ItemPointerCopy(fromPointer, toPointer)
#define ItemPointerIndicatesMovedPartitions(pointer)
#define ItemPointerSet(pointer, blockNumber, offNum)
#define ItemPointerSetOffsetNumber(pointer, offsetNumber)
#define ItemPointerIsValid(pointer)
#define ItemPointerGetOffsetNumber(pointer)
Assert(fmt[strlen(fmt) - 1] !='\n')
void XactLockTableWait(TransactionId xid, Relation rel, ItemPointer ctid, XLTW_Oper oper)
bool ConditionalXactLockTableWait(TransactionId xid)
void MemoryContextReset(MemoryContext context)
void pfree(void *pointer)
void * palloc0(Size size)
#define IsBootstrapProcessingMode()
#define CHECK_FOR_INTERRUPTS()
MultiXactId GetOldestMultiXactId(void)
#define InvalidOffsetNumber
#define OffsetNumberIsValid(offsetNumber)
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
FormData_pg_attribute * Form_pg_attribute
#define ERRCODE_DATA_CORRUPTED
static PgChecksumMode mode
#define ERRCODE_T_R_SERIALIZATION_FAILURE
#define pgstat_count_heap_fetch(rel)
#define pgstat_count_heap_getnext(rel)
#define DatumGetPointer(X)
void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot, TransactionId tuple_xid)
TransactionId GetOldestNonRemovableTransactionId(Relation rel)
#define PROGRESS_CLUSTER_INDEX_RELID
#define PROGRESS_CLUSTER_HEAP_BLKS_SCANNED
#define PROGRESS_CLUSTER_PHASE_SORT_TUPLES
#define PROGRESS_CLUSTER_PHASE_SEQ_SCAN_HEAP
#define PROGRESS_SCAN_BLOCKS_DONE
#define PROGRESS_CLUSTER_PHASE
#define PROGRESS_CLUSTER_HEAP_TUPLES_SCANNED
#define PROGRESS_CLUSTER_TOTAL_HEAP_BLKS
#define PROGRESS_CLUSTER_HEAP_TUPLES_WRITTEN
#define PROGRESS_CLUSTER_PHASE_INDEX_SCAN_HEAP
#define PROGRESS_SCAN_BLOCKS_TOTAL
#define PROGRESS_CLUSTER_PHASE_WRITE_NEW_HEAP
void heap_get_root_tuples(Page page, OffsetNumber *root_offsets)
void heap_page_prune_opt(Relation relation, Buffer buffer)
#define RelationGetRelid(relation)
static SMgrRelation RelationGetSmgr(Relation rel)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
#define RelationGetTargetBlock(relation)
#define RelationIsPermanent(relation)
struct ParallelBlockTableScanDescData * ParallelBlockTableScanDesc
void end_heap_rewrite(RewriteState state)
bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple)
RewriteState begin_heap_rewrite(Relation old_heap, Relation new_heap, TransactionId oldest_xmin, TransactionId freeze_xid, MultiXactId cutoff_multi)
void rewrite_heap_tuple(RewriteState state, HeapTuple old_tuple, HeapTuple new_tuple)
void smgrimmedsync(SMgrRelation reln, ForkNumber forknum)
void smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
void smgrclose(SMgrRelation reln)
bool smgrexists(SMgrRelation reln, ForkNumber forknum)
SMgrRelation smgropen(RelFileNode rnode, BackendId backend)
Snapshot GetTransactionSnapshot(void)
void UnregisterSnapshot(Snapshot snapshot)
Snapshot RegisterSnapshot(Snapshot snapshot)
#define InitDirtySnapshot(snapshotdata)
#define IsMVCCSnapshot(snapshot)
SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, bool register_delete)
void RelationCopyStorage(SMgrRelation src, SMgrRelation dst, ForkNumber forkNum, char relpersistence)
void log_smgrcreate(const RelFileNode *rnode, ForkNumber forkNum)
void RelationDropStorage(Relation rel)
void RelationTruncate(Relation rel, BlockNumber nblocks)
MemoryContext ecxt_per_tuple_memory
TupleTableSlot * ecxt_scantuple
BlockNumber rs_startblock
OffsetNumber rs_vistuples[MaxHeapTuplesPerPage]
TableScanDescData rs_base
IndexFetchTableData xs_base
ExprState * ii_PredicateState
List * ii_ExpressionsState
BlockNumber phs_startblock
struct TsmRoutine * tsmroutine
OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER]
struct SnapshotData * rs_snapshot
struct ParallelTableScanDescData * rs_parallel
NextSampleTuple_function NextSampleTuple
NextSampleBlock_function NextSampleBlock
void ss_report_location(Relation rel, BlockNumber location)
Size table_block_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan)
void table_block_parallelscan_reinitialize(Relation rel, ParallelTableScanDesc pscan)
uint64 table_block_relation_size(Relation rel, ForkNumber forkNumber)
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
Size table_block_parallelscan_estimate(Relation rel)
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 TableScanDesc table_beginscan(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
static TableScanDesc table_beginscan_strat(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool allow_strat, bool allow_sync)
#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION
void(* IndexBuildCallback)(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state)
static bool table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
#define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
#define InvalidTransactionId
#define TransactionIdEquals(id1, id2)
#define TransactionIdIsValid(xid)
#define TupleDescAttr(tupdesc, i)
void tuplesort_performsort(Tuplesortstate *state)
HeapTuple tuplesort_getheaptuple(Tuplesortstate *state, bool forward)
void tuplesort_end(Tuplesortstate *state)
Tuplesortstate * tuplesort_begin_cluster(TupleDesc tupDesc, Relation indexRel, int workMem, SortCoordinate coordinate, int sortopt)
bool tuplesort_getdatum(Tuplesortstate *state, bool forward, Datum *val, bool *isNull, Datum *abbrev)
void tuplesort_putheaptuple(Tuplesortstate *state, HeapTuple tup)
#define att_align_nominal(cur_offset, attalign)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
#define TTS_IS_BUFFERTUPLE(slot)
void heap_vacuum_rel(Relation rel, VacuumParams *params, BufferAccessStrategy bstrategy)
bool TransactionIdIsCurrentTransactionId(TransactionId xid)