#define HEAP_PAGE_PRUNE_FREEZE (1 << 1)
typedef struct BulkInsertStateData *BulkInsertState;
-struct TupleTableSlot;
+typedef struct GlobalVisState GlobalVisState;
+typedef struct TupleTableSlot TupleTableSlot;
struct VacuumCutoffs;
#define MaxLockTupleMode LockTupleExclusive
extern void heap_endscan(TableScanDesc sscan);
extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
extern bool heap_getnextslot(TableScanDesc sscan,
- ScanDirection direction, struct TupleTableSlot *slot);
+ ScanDirection direction, TupleTableSlot *slot);
extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
ItemPointer maxtid);
extern bool heap_getnextslot_tidrange(TableScanDesc sscan,
extern void heap_insert(Relation relation, HeapTuple tup, CommandId cid,
int options, BulkInsertState bistate);
-extern void heap_multi_insert(Relation relation, struct TupleTableSlot **slots,
+extern void heap_multi_insert(Relation relation, TupleTableSlot **slots,
int ntuples, CommandId cid, int options,
BulkInsertState bistate);
extern TM_Result heap_delete(Relation relation, ItemPointer tid,
CommandId cid, Snapshot crosscheck, bool wait,
- struct TM_FailureData *tmfd, bool changingPart);
+ TM_FailureData *tmfd, bool changingPart);
extern void heap_finish_speculative(Relation relation, ItemPointer tid);
extern void heap_abort_speculative(Relation relation, ItemPointer tid);
extern TM_Result heap_update(Relation relation, ItemPointer otid,
HeapTuple newtup,
CommandId cid, Snapshot crosscheck, bool wait,
- struct TM_FailureData *tmfd, LockTupleMode *lockmode,
+ TM_FailureData *tmfd, LockTupleMode *lockmode,
TU_UpdateIndexes *update_indexes);
extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
bool follow_updates,
- Buffer *buffer, struct TM_FailureData *tmfd);
+ Buffer *buffer, TM_FailureData *tmfd);
extern bool heap_inplace_lock(Relation relation,
HeapTuple oldtup_ptr, Buffer buffer,
TM_IndexDeleteOp *delstate);
/* in heap/pruneheap.c */
-struct GlobalVisState;
extern void heap_page_prune_opt(Relation relation, Buffer buffer);
extern void heap_page_prune_and_freeze(Relation relation, Buffer buffer,
- struct GlobalVisState *vistest,
+ GlobalVisState *vistest,
int options,
struct VacuumCutoffs *cutoffs,
PruneFreezeResult *presult,
uint16 infomask, TransactionId xid);
extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
extern bool HeapTupleIsSurelyDead(HeapTuple htup,
- struct GlobalVisState *vistest);
+ GlobalVisState *vistest);
/*
* To avoid leaking too much knowledge about reorderbuffer implementation
extern PGDLLIMPORT bool synchronize_seqscans;
-struct BulkInsertStateData;
-struct IndexInfo;
-struct SampleScanState;
-struct ValidateIndexState;
+/* forward references in this file */
+typedef struct BulkInsertStateData BulkInsertStateData;
+typedef struct IndexInfo IndexInfo;
+typedef struct SampleScanState SampleScanState;
+typedef struct ValidateIndexState ValidateIndexState;
/*
* Bitmask values for the flags argument to the scan_begin callback.
*/
TableScanDesc (*scan_begin) (Relation rel,
Snapshot snapshot,
- int nkeys, struct ScanKeyData *key,
+ int nkeys, ScanKeyData *key,
ParallelTableScanDesc pscan,
uint32 flags);
* Restart relation scan. If set_params is set to true, allow_{strat,
* sync, pagemode} (see scan_begin) changes should be taken into account.
*/
- void (*scan_rescan) (TableScanDesc scan, struct ScanKeyData *key,
+ void (*scan_rescan) (TableScanDesc scan, ScanKeyData *key,
bool set_params, bool allow_strat,
bool allow_sync, bool allow_pagemode);
/* see table_tuple_insert() for reference about parameters */
void (*tuple_insert) (Relation rel, TupleTableSlot *slot,
CommandId cid, int options,
- struct BulkInsertStateData *bistate);
+ BulkInsertStateData *bistate);
/* see table_tuple_insert_speculative() for reference about parameters */
void (*tuple_insert_speculative) (Relation rel,
TupleTableSlot *slot,
CommandId cid,
int options,
- struct BulkInsertStateData *bistate,
+ BulkInsertStateData *bistate,
uint32 specToken);
/* see table_tuple_complete_speculative() for reference about parameters */
/* see table_multi_insert() for reference about parameters */
void (*multi_insert) (Relation rel, TupleTableSlot **slots, int nslots,
- CommandId cid, int options, struct BulkInsertStateData *bistate);
+ CommandId cid, int options, BulkInsertStateData *bistate);
/* see table_tuple_delete() for reference about parameters */
TM_Result (*tuple_delete) (Relation rel,
/* see table_index_build_range_scan for reference about parameters */
double (*index_build_range_scan) (Relation table_rel,
Relation index_rel,
- struct IndexInfo *index_info,
+ IndexInfo *index_info,
bool allow_sync,
bool anyvisible,
bool progress,
/* see table_index_validate_scan for reference about parameters */
void (*index_validate_scan) (Relation table_rel,
Relation index_rel,
- struct IndexInfo *index_info,
+ IndexInfo *index_info,
Snapshot snapshot,
- struct ValidateIndexState *state);
+ ValidateIndexState *state);
/* ------------------------------------------------------------------------
* scans. If infeasible to implement, the AM may raise an error.
*/
bool (*scan_sample_next_block) (TableScanDesc scan,
- struct SampleScanState *scanstate);
+ SampleScanState *scanstate);
/*
* This callback, only called after scan_sample_next_block has returned
* assumption somehow.
*/
bool (*scan_sample_next_tuple) (TableScanDesc scan,
- struct SampleScanState *scanstate,
+ SampleScanState *scanstate,
TupleTableSlot *slot);
} TableAmRoutine;
*/
static inline TableScanDesc
table_beginscan(Relation rel, Snapshot snapshot,
- int nkeys, struct ScanKeyData *key)
+ int nkeys, ScanKeyData *key)
{
uint32 flags = SO_TYPE_SEQSCAN |
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
* snapshot appropriate for scanning catalog relations.
*/
extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
- struct ScanKeyData *key);
+ ScanKeyData *key);
/*
* Like table_beginscan(), but table_beginscan_strat() offers an extended API
*/
static inline TableScanDesc
table_beginscan_strat(Relation rel, Snapshot snapshot,
- int nkeys, struct ScanKeyData *key,
+ int nkeys, ScanKeyData *key,
bool allow_strat, bool allow_sync)
{
uint32 flags = SO_TYPE_SEQSCAN | SO_ALLOW_PAGEMODE;
*/
static inline TableScanDesc
table_beginscan_bm(Relation rel, Snapshot snapshot,
- int nkeys, struct ScanKeyData *key)
+ int nkeys, ScanKeyData *key)
{
uint32 flags = SO_TYPE_BITMAPSCAN | SO_ALLOW_PAGEMODE;
*/
static inline TableScanDesc
table_beginscan_sampling(Relation rel, Snapshot snapshot,
- int nkeys, struct ScanKeyData *key,
+ int nkeys, ScanKeyData *key,
bool allow_strat, bool allow_sync,
bool allow_pagemode)
{
* Restart a relation scan.
*/
static inline void
-table_rescan(TableScanDesc scan,
- struct ScanKeyData *key)
+table_rescan(TableScanDesc scan, ScanKeyData *key)
{
scan->rs_rd->rd_tableam->scan_rescan(scan, key, false, false, false, false);
}
* previously selected startblock will be kept.
*/
static inline void
-table_rescan_set_params(TableScanDesc scan, struct ScanKeyData *key,
+table_rescan_set_params(TableScanDesc scan, ScanKeyData *key,
bool allow_strat, bool allow_sync, bool allow_pagemode)
{
scan->rs_rd->rd_tableam->scan_rescan(scan, key, true,
*/
static inline void
table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid,
- int options, struct BulkInsertStateData *bistate)
+ int options, BulkInsertStateData *bistate)
{
rel->rd_tableam->tuple_insert(rel, slot, cid, options,
bistate);
static inline void
table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot,
CommandId cid, int options,
- struct BulkInsertStateData *bistate,
+ BulkInsertStateData *bistate,
uint32 specToken)
{
rel->rd_tableam->tuple_insert_speculative(rel, slot, cid, options,
*/
static inline void
table_multi_insert(Relation rel, TupleTableSlot **slots, int nslots,
- CommandId cid, int options, struct BulkInsertStateData *bistate)
+ CommandId cid, int options, BulkInsertStateData *bistate)
{
rel->rd_tableam->multi_insert(rel, slots, nslots,
cid, options, bistate);
static inline double
table_index_build_scan(Relation table_rel,
Relation index_rel,
- struct IndexInfo *index_info,
+ IndexInfo *index_info,
bool allow_sync,
bool progress,
IndexBuildCallback callback,
static inline double
table_index_build_range_scan(Relation table_rel,
Relation index_rel,
- struct IndexInfo *index_info,
+ IndexInfo *index_info,
bool allow_sync,
bool anyvisible,
bool progress,
static inline void
table_index_validate_scan(Relation table_rel,
Relation index_rel,
- struct IndexInfo *index_info,
+ IndexInfo *index_info,
Snapshot snapshot,
- struct ValidateIndexState *state)
+ ValidateIndexState *state)
{
table_rel->rd_tableam->index_validate_scan(table_rel,
index_rel,
*/
static inline bool
table_scan_sample_next_block(TableScanDesc scan,
- struct SampleScanState *scanstate)
+ SampleScanState *scanstate)
{
/*
* We don't expect direct calls to table_scan_sample_next_block with valid
*/
static inline bool
table_scan_sample_next_tuple(TableScanDesc scan,
- struct SampleScanState *scanstate,
+ SampleScanState *scanstate,
TupleTableSlot *slot)
{
/*