202 indrelid = idxrec->indrelid;
203 Assert(indexrelid == idxrec->indexrelid);
217 for (keyno = 0; keyno < indnkeyatts; keyno++)
241 for (i = 0; i < indnkeyatts; i++)
263 &foutoid, &typisvarlena);
311 for (
int i = 0;
i < nitems;
i++)
339 return latestRemovedXid;
400 sysscan->
irel = irel;
403 if (snapshot == NULL)
421 for (i = 0; i < nkeys; i++)
427 if (key[i].sk_attno == irel->
rd_index->indkey.values[j])
440 sysscan->
scan = NULL;
454 sysscan->
iscan = NULL;
483 (
errcode(ERRCODE_TRANSACTION_ROLLBACK),
484 errmsg(
"transaction aborted during system catalog scan")));
522 elog(
ERROR,
"system catalog scans with lossy index conditions are not implemented");
598 sysscan->
slot = NULL;
650 elog(
ERROR,
"cannot do ordered scan on index \"%s\", because it is being reindexed",
654 elog(
WARNING,
"using index \"%s\" despite IgnoreSystemIndexes",
660 sysscan->
irel = indexRelation;
663 if (snapshot == NULL)
677 for (i = 0; i < nkeys; i++)
683 if (key[i].sk_attno == indexRelation->
rd_index->indkey.values[j])
696 sysscan->
scan = NULL;
715 elog(
ERROR,
"system catalog scans with lossy index conditions are not implemented");
735 sysscan->
slot = NULL;
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
static TransactionId table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
struct SysScanDescData * SysScanDesc
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
void systable_endscan(SysScanDesc sysscan)
bool TransactionStartedDuringRecovery(void)
struct ScanKeyData * orderByData
Snapshot RegisterSnapshot(Snapshot snapshot)
AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mode)
struct SnapshotData * snapshot
bool TransactionIdIsInProgress(TransactionId xid)
struct TupleDescData * xs_itupdesc
struct TupleDescData * xs_hitupdesc
Snapshot GetCatalogSnapshot(Oid relid)
char * pg_get_indexdef_columns(Oid indexrelid, bool pretty)
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
int errcode(int sqlerrcode)
struct SnapshotData * xs_snapshot
bool TransactionIdDidCommit(TransactionId transactionId)
HeapTuple systable_getnext_ordered(SysScanDesc sysscan, ScanDirection direction)
static bool table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
#define ItemIdIsDead(itemId)
struct IndexScanDescData * iscan
struct TupleTableSlot * slot
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
static TableScanDesc table_beginscan_strat(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool allow_strat, bool allow_sync)
bool ignore_killed_tuples
bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup)
HeapTuple systable_getnext(SysScanDesc sysscan)
void pfree(void *pointer)
void appendStringInfo(StringInfo str, const char *fmt,...)
struct TableScanDescData * scan
void appendStringInfoString(StringInfo str, const char *s)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
bool xactStartedInRecovery
IndexTupleData * IndexTuple
#define IndexRelationGetNumberOfAttributes(relation)
#define InvalidTransactionId
#define RelationGetRelationName(relation)
void IndexScanEnd(IndexScanDesc scan)
#define IndexRelationGetNumberOfKeyAttributes(relation)
void index_endscan(IndexScanDesc scan)
#define BufferGetPage(buffer)
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
void UnregisterSnapshot(Snapshot snapshot)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
TransactionId CheckXidAlive
FormData_pg_index * Form_pg_index
#define PageGetItemId(page, offsetNumber)
void systable_endscan_ordered(SysScanDesc sysscan)
#define InvalidOffsetNumber
#define ereport(elevel,...)
int check_enable_rls(Oid relid, Oid checkAsUser, bool noError)
static bool table_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
#define Assert(condition)
IndexFetchTableData * xs_heapfetch
bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
#define InvalidAttrNumber
void index_close(Relation relation, LOCKMODE lockmode)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
struct ScanKeyData * keyData
static void table_endscan(TableScanDesc scan)
static Datum values[MAXATTR]
char * OidOutputFunctionCall(Oid functionId, Datum val)
int errmsg(const char *fmt,...)
SysScanDesc systable_beginscan_ordered(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, ScanKey key)
IndexScanDesc RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
char * BuildIndexValueDescription(Relation indexRelation, Datum *values, bool *isnull)
#define TransactionIdIsValid(xid)
bool ReindexIsProcessingIndex(Oid indexOid)
static void HandleConcurrentAbort()
struct IndexScanDescData * IndexScanDesc
#define RelationGetRelid(relation)
Relation index_open(Oid relationId, LOCKMODE lockmode)
#define PageGetItem(page, itemId)
IndexScanDesc index_beginscan(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, int norderbys)
#define ItemPointerCopy(fromPointer, toPointer)
TransactionId index_compute_xid_horizon_for_tuples(Relation irel, Relation hrel, Buffer ibuf, OffsetNumber *itemnos, int nitems)