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);
307 delstate.
irel = irel;
345 return snapshotConflictHorizon;
406 sysscan->
irel = irel;
409 if (snapshot == NULL)
427 for (
i = 0;
i < nkeys;
i++)
435 key[
i].sk_attno =
j + 1;
446 sysscan->
scan = NULL;
460 sysscan->
iscan = NULL;
489 (
errcode(ERRCODE_TRANSACTION_ROLLBACK),
490 errmsg(
"transaction aborted during system catalog scan")));
528 elog(
ERROR,
"system catalog scans with lossy index conditions are not implemented");
604 sysscan->
slot = NULL;
656 elog(
ERROR,
"cannot do ordered scan on index \"%s\", because it is being reindexed",
660 elog(
WARNING,
"using index \"%s\" despite IgnoreSystemIndexes",
666 sysscan->
irel = indexRelation;
669 if (snapshot == NULL)
683 for (
i = 0;
i < nkeys;
i++)
689 if (
key[
i].sk_attno == indexRelation->
rd_index->indkey.values[
j])
691 key[
i].sk_attno =
j + 1;
702 sysscan->
scan = NULL;
721 elog(
ERROR,
"system catalog scans with lossy index conditions are not implemented");
741 sysscan->
slot = NULL;
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(Page page, ItemId itemId)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
elog(ERROR, "%s: %s", p2, msg)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
char * OidOutputFunctionCall(Oid functionId, Datum val)
void systable_endscan(SysScanDesc sysscan)
bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup)
void IndexScanEnd(IndexScanDesc scan)
char * BuildIndexValueDescription(Relation indexRelation, Datum *values, bool *isnull)
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)
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
bool ReindexIsProcessingIndex(Oid indexOid)
bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
void index_close(Relation relation, LOCKMODE lockmode)
IndexScanDesc index_beginscan(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, int norderbys)
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 ItemIdIsDead(itemId)
static void ItemPointerCopy(const ItemPointerData *fromPointer, ItemPointerData *toPointer)
IndexTupleData * IndexTuple
Assert(fmt[strlen(fmt) - 1] !='\n')
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
void pfree(void *pointer)
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 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)
bool TransactionStartedDuringRecovery(void)
TransactionId CheckXidAlive