203 indrelid = idxrec->indrelid;
204 Assert(indexrelid == idxrec->indexrelid);
218 for (keyno = 0; keyno < indnkeyatts; keyno++)
242 for (
i = 0;
i < indnkeyatts;
i++)
264 &foutoid, &typisvarlena);
308 delstate.
irel = irel;
346 return snapshotConflictHorizon;
407 sysscan->
irel = irel;
410 if (snapshot == NULL)
431 for (
i = 0;
i < nkeys;
i++)
450 snapshot, NULL, nkeys, 0);
452 sysscan->
scan = NULL;
468 sysscan->
iscan = NULL;
497 (
errcode(ERRCODE_TRANSACTION_ROLLBACK),
498 errmsg(
"transaction aborted during system catalog scan")));
536 elog(
ERROR,
"system catalog scans with lossy index conditions are not implemented");
608 sysscan->
slot = NULL;
662 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
663 errmsg(
"cannot access index \"%s\" while it is being reindexed",
667 elog(
WARNING,
"using index \"%s\" despite IgnoreSystemIndexes",
673 sysscan->
irel = indexRelation;
676 if (snapshot == NULL)
692 for (
i = 0;
i < nkeys;
i++)
700 if (
key[
i].sk_attno == indexRelation->
rd_index->indkey.values[
j])
711 snapshot, NULL, nkeys, 0);
713 sysscan->
scan = NULL;
742 elog(
ERROR,
"system catalog scans with lossy index conditions are not implemented");
762 sysscan->
slot = NULL;
828 (
errcode(ERRCODE_INVALID_TRANSACTION_STATE),
829 errmsg(
"cannot update tuples during a parallel operation")));
851 if (retries++ > 10000)
852 elog(
ERROR,
"giving up after too many tries to overwrite row");
869 bslot->base.tuple, bslot->
buffer,
AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mode)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
#define InvalidAttrNumber
static Datum values[MAXATTR]
BlockNumber BufferGetBlockNumber(Buffer buffer)
static Page BufferGetPage(Buffer buffer)
static Item PageGetItem(const PageData *page, const ItemIdData *itemId)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
#define unconstify(underlying_type, expr)
bool IsSystemRelation(Relation relation)
bool IsInplaceUpdateRelation(Relation relation)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
#define palloc_array(type, count)
char * OidOutputFunctionCall(Oid functionId, Datum val)
char * BuildIndexValueDescription(Relation indexRelation, const Datum *values, const bool *isnull)
void systable_endscan(SysScanDesc sysscan)
void systable_inplace_update_cancel(void *state)
bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup)
void IndexScanEnd(IndexScanDesc scan)
void systable_inplace_update_begin(Relation relation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, const ScanKeyData *key, HeapTuple *oldtupcopy, void **state)
TransactionId index_compute_xid_horizon_for_tuples(Relation irel, Relation hrel, Buffer ibuf, OffsetNumber *itemnos, int nitems)
static void HandleConcurrentAbort()
SysScanDesc systable_beginscan_ordered(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, ScanKey key)
void systable_inplace_update_finish(void *state, HeapTuple tuple)
HeapTuple systable_getnext(SysScanDesc sysscan)
void systable_endscan_ordered(SysScanDesc sysscan)
HeapTuple systable_getnext_ordered(SysScanDesc sysscan, ScanDirection direction)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
IndexScanDesc RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
struct SysScanDescData * SysScanDesc
struct IndexScanDescData * IndexScanDesc
Assert(PointerIsAligned(start, uint64))
bool heap_inplace_lock(Relation relation, HeapTuple oldtup_ptr, Buffer buffer, void(*release_callback)(void *), void *arg)
void heap_inplace_unlock(Relation relation, HeapTuple oldtup, Buffer buffer)
void heap_inplace_update_and_unlock(Relation relation, HeapTuple oldtup, HeapTuple tuple, Buffer buffer)
HeapTuple heap_copytuple(HeapTuple tuple)
#define HeapTupleIsValid(tuple)
bool ReindexIsProcessingIndex(Oid indexOid)
bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
IndexScanDesc index_beginscan(Relation heapRelation, Relation indexRelation, Snapshot snapshot, IndexScanInstrumentation *instrument, int nkeys, int norderbys)
void index_close(Relation relation, LOCKMODE lockmode)
void index_endscan(IndexScanDesc scan)
Relation index_open(Oid relationId, LOCKMODE lockmode)
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
#define INJECTION_POINT(name)
#define ItemIdIsDead(itemId)
static void ItemPointerCopy(const ItemPointerData *fromPointer, ItemPointerData *toPointer)
IndexTupleData * IndexTuple
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
FormData_pg_index * Form_pg_index
bool TransactionIdIsInProgress(TransactionId xid)
#define RelationGetRelid(relation)
#define RelationGetRelationName(relation)
#define IndexRelationGetNumberOfAttributes(relation)
#define IndexRelationGetNumberOfKeyAttributes(relation)
int check_enable_rls(Oid relid, Oid checkAsUser, bool noError)
char * pg_get_indexdef_columns(Oid indexrelid, bool pretty)
Snapshot GetCatalogSnapshot(Oid relid)
void UnregisterSnapshot(Snapshot snapshot)
Snapshot RegisterSnapshot(Snapshot snapshot)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct ScanKeyData * keyData
struct ScanKeyData * orderByData
bool ignore_killed_tuples
IndexFetchTableData * xs_heapfetch
bool xactStartedInRecovery
struct IndexScanInstrumentation * instrument
struct TupleDescData * xs_hitupdesc
struct TupleDescData * xs_itupdesc
struct SnapshotData * xs_snapshot
struct SnapshotData * snapshot
struct IndexScanDescData * iscan
struct TupleTableSlot * slot
struct TableScanDescData * scan
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
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)
static bool table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
static bool table_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
static TransactionId table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
bool TransactionIdDidCommit(TransactionId transactionId)
#define InvalidTransactionId
#define TransactionIdIsValid(xid)
#define TTS_IS_BUFFERTUPLE(slot)
bool TransactionStartedDuringRecovery(void)
TransactionId CheckXidAlive
bool IsInParallelMode(void)