mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Update some more forward declarations to use typedef
As commit d4d1fc527b.
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/202509191025.22agk3fvpilc@alvherre.pgsql
This commit is contained in:
@@ -110,7 +110,7 @@ table_slot_create(Relation relation, List **reglist)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
TableScanDesc
|
TableScanDesc
|
||||||
table_beginscan_catalog(Relation relation, int nkeys, struct ScanKeyData *key)
|
table_beginscan_catalog(Relation relation, int nkeys, ScanKeyData *key)
|
||||||
{
|
{
|
||||||
uint32 flags = SO_TYPE_SEQSCAN |
|
uint32 flags = SO_TYPE_SEQSCAN |
|
||||||
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE | SO_TEMP_SNAPSHOT;
|
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE | SO_TEMP_SNAPSHOT;
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
* AM's implementation isn't concerned with those data structures. To allow
|
* AM's implementation isn't concerned with those data structures. To allow
|
||||||
* declaring amcostestimate_function here, use forward struct references.
|
* declaring amcostestimate_function here, use forward struct references.
|
||||||
*/
|
*/
|
||||||
struct PlannerInfo;
|
typedef struct PlannerInfo PlannerInfo;
|
||||||
struct IndexPath;
|
typedef struct IndexPath IndexPath;
|
||||||
|
|
||||||
/* Likewise, this file shouldn't depend on execnodes.h. */
|
/* Likewise, this file shouldn't depend on execnodes.h. */
|
||||||
struct IndexInfo;
|
typedef struct IndexInfo IndexInfo;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -110,7 +110,7 @@ typedef StrategyNumber (*amtranslate_cmptype_function) (CompareType cmptype, Oid
|
|||||||
/* build new index */
|
/* build new index */
|
||||||
typedef IndexBuildResult *(*ambuild_function) (Relation heapRelation,
|
typedef IndexBuildResult *(*ambuild_function) (Relation heapRelation,
|
||||||
Relation indexRelation,
|
Relation indexRelation,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
|
|
||||||
/* build empty index */
|
/* build empty index */
|
||||||
typedef void (*ambuildempty_function) (Relation indexRelation);
|
typedef void (*ambuildempty_function) (Relation indexRelation);
|
||||||
@@ -123,11 +123,11 @@ typedef bool (*aminsert_function) (Relation indexRelation,
|
|||||||
Relation heapRelation,
|
Relation heapRelation,
|
||||||
IndexUniqueCheck checkUnique,
|
IndexUniqueCheck checkUnique,
|
||||||
bool indexUnchanged,
|
bool indexUnchanged,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
|
|
||||||
/* cleanup after insert */
|
/* cleanup after insert */
|
||||||
typedef void (*aminsertcleanup_function) (Relation indexRelation,
|
typedef void (*aminsertcleanup_function) (Relation indexRelation,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
|
|
||||||
/* bulk delete */
|
/* bulk delete */
|
||||||
typedef IndexBulkDeleteResult *(*ambulkdelete_function) (IndexVacuumInfo *info,
|
typedef IndexBulkDeleteResult *(*ambulkdelete_function) (IndexVacuumInfo *info,
|
||||||
@@ -143,8 +143,8 @@ typedef IndexBulkDeleteResult *(*amvacuumcleanup_function) (IndexVacuumInfo *inf
|
|||||||
typedef bool (*amcanreturn_function) (Relation indexRelation, int attno);
|
typedef bool (*amcanreturn_function) (Relation indexRelation, int attno);
|
||||||
|
|
||||||
/* estimate cost of an indexscan */
|
/* estimate cost of an indexscan */
|
||||||
typedef void (*amcostestimate_function) (struct PlannerInfo *root,
|
typedef void (*amcostestimate_function) (PlannerInfo *root,
|
||||||
struct IndexPath *path,
|
IndexPath *path,
|
||||||
double loop_count,
|
double loop_count,
|
||||||
Cost *indexStartupCost,
|
Cost *indexStartupCost,
|
||||||
Cost *indexTotalCost,
|
Cost *indexTotalCost,
|
||||||
|
|||||||
@@ -89,14 +89,14 @@ typedef struct BrinDesc
|
|||||||
extern BrinDesc *brin_build_desc(Relation rel);
|
extern BrinDesc *brin_build_desc(Relation rel);
|
||||||
extern void brin_free_desc(BrinDesc *bdesc);
|
extern void brin_free_desc(BrinDesc *bdesc);
|
||||||
extern IndexBuildResult *brinbuild(Relation heap, Relation index,
|
extern IndexBuildResult *brinbuild(Relation heap, Relation index,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
extern void brinbuildempty(Relation index);
|
extern void brinbuildempty(Relation index);
|
||||||
extern bool brininsert(Relation idxRel, Datum *values, bool *nulls,
|
extern bool brininsert(Relation idxRel, Datum *values, bool *nulls,
|
||||||
ItemPointer heaptid, Relation heapRel,
|
ItemPointer heaptid, Relation heapRel,
|
||||||
IndexUniqueCheck checkUnique,
|
IndexUniqueCheck checkUnique,
|
||||||
bool indexUnchanged,
|
bool indexUnchanged,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
extern void brininsertcleanup(Relation index, struct IndexInfo *indexInfo);
|
extern void brininsertcleanup(Relation index, IndexInfo *indexInfo);
|
||||||
extern IndexScanDesc brinbeginscan(Relation r, int nkeys, int norderbys);
|
extern IndexScanDesc brinbeginscan(Relation r, int nkeys, int norderbys);
|
||||||
extern int64 bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
|
extern int64 bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
|
||||||
extern void brinrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
|
extern void brinrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
|
||||||
|
|||||||
@@ -24,7 +24,9 @@
|
|||||||
#include "utils/snapshot.h"
|
#include "utils/snapshot.h"
|
||||||
|
|
||||||
/* We don't want this file to depend on execnodes.h. */
|
/* We don't want this file to depend on execnodes.h. */
|
||||||
struct IndexInfo;
|
typedef struct IndexInfo IndexInfo;
|
||||||
|
typedef struct TupleTableSlot TupleTableSlot;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Struct for statistics maintained by amgettuple and amgetbitmap
|
* Struct for statistics maintained by amgettuple and amgetbitmap
|
||||||
@@ -165,9 +167,9 @@ extern bool index_insert(Relation indexRelation,
|
|||||||
Relation heapRelation,
|
Relation heapRelation,
|
||||||
IndexUniqueCheck checkUnique,
|
IndexUniqueCheck checkUnique,
|
||||||
bool indexUnchanged,
|
bool indexUnchanged,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
extern void index_insert_cleanup(Relation indexRelation,
|
extern void index_insert_cleanup(Relation indexRelation,
|
||||||
struct IndexInfo *indexInfo);
|
IndexInfo *indexInfo);
|
||||||
|
|
||||||
extern IndexScanDesc index_beginscan(Relation heapRelation,
|
extern IndexScanDesc index_beginscan(Relation heapRelation,
|
||||||
Relation indexRelation,
|
Relation indexRelation,
|
||||||
@@ -202,10 +204,9 @@ extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
|
|||||||
ParallelIndexScanDesc pscan);
|
ParallelIndexScanDesc pscan);
|
||||||
extern ItemPointer index_getnext_tid(IndexScanDesc scan,
|
extern ItemPointer index_getnext_tid(IndexScanDesc scan,
|
||||||
ScanDirection direction);
|
ScanDirection direction);
|
||||||
struct TupleTableSlot;
|
extern bool index_fetch_heap(IndexScanDesc scan, TupleTableSlot *slot);
|
||||||
extern bool index_fetch_heap(IndexScanDesc scan, struct TupleTableSlot *slot);
|
|
||||||
extern bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction,
|
extern bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction,
|
||||||
struct TupleTableSlot *slot);
|
TupleTableSlot *slot);
|
||||||
extern int64 index_getbitmap(IndexScanDesc scan, TIDBitmap *bitmap);
|
extern int64 index_getbitmap(IndexScanDesc scan, TIDBitmap *bitmap);
|
||||||
|
|
||||||
extern IndexBulkDeleteResult *index_bulk_delete(IndexVacuumInfo *info,
|
extern IndexBulkDeleteResult *index_bulk_delete(IndexVacuumInfo *info,
|
||||||
|
|||||||
@@ -44,7 +44,8 @@
|
|||||||
#define HEAP_PAGE_PRUNE_FREEZE (1 << 1)
|
#define HEAP_PAGE_PRUNE_FREEZE (1 << 1)
|
||||||
|
|
||||||
typedef struct BulkInsertStateData *BulkInsertState;
|
typedef struct BulkInsertStateData *BulkInsertState;
|
||||||
struct TupleTableSlot;
|
typedef struct GlobalVisState GlobalVisState;
|
||||||
|
typedef struct TupleTableSlot TupleTableSlot;
|
||||||
struct VacuumCutoffs;
|
struct VacuumCutoffs;
|
||||||
|
|
||||||
#define MaxLockTupleMode LockTupleExclusive
|
#define MaxLockTupleMode LockTupleExclusive
|
||||||
@@ -292,7 +293,7 @@ extern void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params,
|
|||||||
extern void heap_endscan(TableScanDesc sscan);
|
extern void heap_endscan(TableScanDesc sscan);
|
||||||
extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
|
extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
|
||||||
extern bool heap_getnextslot(TableScanDesc sscan,
|
extern bool heap_getnextslot(TableScanDesc sscan,
|
||||||
ScanDirection direction, struct TupleTableSlot *slot);
|
ScanDirection direction, TupleTableSlot *slot);
|
||||||
extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
|
extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
|
||||||
ItemPointer maxtid);
|
ItemPointer maxtid);
|
||||||
extern bool heap_getnextslot_tidrange(TableScanDesc sscan,
|
extern bool heap_getnextslot_tidrange(TableScanDesc sscan,
|
||||||
@@ -312,23 +313,23 @@ extern void ReleaseBulkInsertStatePin(BulkInsertState bistate);
|
|||||||
|
|
||||||
extern void heap_insert(Relation relation, HeapTuple tup, CommandId cid,
|
extern void heap_insert(Relation relation, HeapTuple tup, CommandId cid,
|
||||||
int options, BulkInsertState bistate);
|
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,
|
int ntuples, CommandId cid, int options,
|
||||||
BulkInsertState bistate);
|
BulkInsertState bistate);
|
||||||
extern TM_Result heap_delete(Relation relation, ItemPointer tid,
|
extern TM_Result heap_delete(Relation relation, ItemPointer tid,
|
||||||
CommandId cid, Snapshot crosscheck, bool wait,
|
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_finish_speculative(Relation relation, ItemPointer tid);
|
||||||
extern void heap_abort_speculative(Relation relation, ItemPointer tid);
|
extern void heap_abort_speculative(Relation relation, ItemPointer tid);
|
||||||
extern TM_Result heap_update(Relation relation, ItemPointer otid,
|
extern TM_Result heap_update(Relation relation, ItemPointer otid,
|
||||||
HeapTuple newtup,
|
HeapTuple newtup,
|
||||||
CommandId cid, Snapshot crosscheck, bool wait,
|
CommandId cid, Snapshot crosscheck, bool wait,
|
||||||
struct TM_FailureData *tmfd, LockTupleMode *lockmode,
|
TM_FailureData *tmfd, LockTupleMode *lockmode,
|
||||||
TU_UpdateIndexes *update_indexes);
|
TU_UpdateIndexes *update_indexes);
|
||||||
extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
|
extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
|
||||||
CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
|
CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
|
||||||
bool follow_updates,
|
bool follow_updates,
|
||||||
Buffer *buffer, struct TM_FailureData *tmfd);
|
Buffer *buffer, TM_FailureData *tmfd);
|
||||||
|
|
||||||
extern bool heap_inplace_lock(Relation relation,
|
extern bool heap_inplace_lock(Relation relation,
|
||||||
HeapTuple oldtup_ptr, Buffer buffer,
|
HeapTuple oldtup_ptr, Buffer buffer,
|
||||||
@@ -365,10 +366,9 @@ extern TransactionId heap_index_delete_tuples(Relation rel,
|
|||||||
TM_IndexDeleteOp *delstate);
|
TM_IndexDeleteOp *delstate);
|
||||||
|
|
||||||
/* in heap/pruneheap.c */
|
/* in heap/pruneheap.c */
|
||||||
struct GlobalVisState;
|
|
||||||
extern void heap_page_prune_opt(Relation relation, Buffer buffer);
|
extern void heap_page_prune_opt(Relation relation, Buffer buffer);
|
||||||
extern void heap_page_prune_and_freeze(Relation relation, Buffer buffer,
|
extern void heap_page_prune_and_freeze(Relation relation, Buffer buffer,
|
||||||
struct GlobalVisState *vistest,
|
GlobalVisState *vistest,
|
||||||
int options,
|
int options,
|
||||||
struct VacuumCutoffs *cutoffs,
|
struct VacuumCutoffs *cutoffs,
|
||||||
PruneFreezeResult *presult,
|
PruneFreezeResult *presult,
|
||||||
@@ -407,7 +407,7 @@ extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
|
|||||||
uint16 infomask, TransactionId xid);
|
uint16 infomask, TransactionId xid);
|
||||||
extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
|
extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
|
||||||
extern bool HeapTupleIsSurelyDead(HeapTuple htup,
|
extern bool HeapTupleIsSurelyDead(HeapTuple htup,
|
||||||
struct GlobalVisState *vistest);
|
GlobalVisState *vistest);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To avoid leaking too much knowledge about reorderbuffer implementation
|
* To avoid leaking too much knowledge about reorderbuffer implementation
|
||||||
|
|||||||
@@ -34,10 +34,11 @@ extern PGDLLIMPORT char *default_table_access_method;
|
|||||||
extern PGDLLIMPORT bool synchronize_seqscans;
|
extern PGDLLIMPORT bool synchronize_seqscans;
|
||||||
|
|
||||||
|
|
||||||
struct BulkInsertStateData;
|
/* forward references in this file */
|
||||||
struct IndexInfo;
|
typedef struct BulkInsertStateData BulkInsertStateData;
|
||||||
struct SampleScanState;
|
typedef struct IndexInfo IndexInfo;
|
||||||
struct ValidateIndexState;
|
typedef struct SampleScanState SampleScanState;
|
||||||
|
typedef struct ValidateIndexState ValidateIndexState;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Bitmask values for the flags argument to the scan_begin callback.
|
* Bitmask values for the flags argument to the scan_begin callback.
|
||||||
@@ -325,7 +326,7 @@ typedef struct TableAmRoutine
|
|||||||
*/
|
*/
|
||||||
TableScanDesc (*scan_begin) (Relation rel,
|
TableScanDesc (*scan_begin) (Relation rel,
|
||||||
Snapshot snapshot,
|
Snapshot snapshot,
|
||||||
int nkeys, struct ScanKeyData *key,
|
int nkeys, ScanKeyData *key,
|
||||||
ParallelTableScanDesc pscan,
|
ParallelTableScanDesc pscan,
|
||||||
uint32 flags);
|
uint32 flags);
|
||||||
|
|
||||||
@@ -339,7 +340,7 @@ typedef struct TableAmRoutine
|
|||||||
* Restart relation scan. If set_params is set to true, allow_{strat,
|
* Restart relation scan. If set_params is set to true, allow_{strat,
|
||||||
* sync, pagemode} (see scan_begin) changes should be taken into account.
|
* 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 set_params, bool allow_strat,
|
||||||
bool allow_sync, bool allow_pagemode);
|
bool allow_sync, bool allow_pagemode);
|
||||||
|
|
||||||
@@ -508,14 +509,14 @@ typedef struct TableAmRoutine
|
|||||||
/* see table_tuple_insert() for reference about parameters */
|
/* see table_tuple_insert() for reference about parameters */
|
||||||
void (*tuple_insert) (Relation rel, TupleTableSlot *slot,
|
void (*tuple_insert) (Relation rel, TupleTableSlot *slot,
|
||||||
CommandId cid, int options,
|
CommandId cid, int options,
|
||||||
struct BulkInsertStateData *bistate);
|
BulkInsertStateData *bistate);
|
||||||
|
|
||||||
/* see table_tuple_insert_speculative() for reference about parameters */
|
/* see table_tuple_insert_speculative() for reference about parameters */
|
||||||
void (*tuple_insert_speculative) (Relation rel,
|
void (*tuple_insert_speculative) (Relation rel,
|
||||||
TupleTableSlot *slot,
|
TupleTableSlot *slot,
|
||||||
CommandId cid,
|
CommandId cid,
|
||||||
int options,
|
int options,
|
||||||
struct BulkInsertStateData *bistate,
|
BulkInsertStateData *bistate,
|
||||||
uint32 specToken);
|
uint32 specToken);
|
||||||
|
|
||||||
/* see table_tuple_complete_speculative() for reference about parameters */
|
/* see table_tuple_complete_speculative() for reference about parameters */
|
||||||
@@ -526,7 +527,7 @@ typedef struct TableAmRoutine
|
|||||||
|
|
||||||
/* see table_multi_insert() for reference about parameters */
|
/* see table_multi_insert() for reference about parameters */
|
||||||
void (*multi_insert) (Relation rel, TupleTableSlot **slots, int nslots,
|
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 */
|
/* see table_tuple_delete() for reference about parameters */
|
||||||
TM_Result (*tuple_delete) (Relation rel,
|
TM_Result (*tuple_delete) (Relation rel,
|
||||||
@@ -690,7 +691,7 @@ typedef struct TableAmRoutine
|
|||||||
/* see table_index_build_range_scan for reference about parameters */
|
/* see table_index_build_range_scan for reference about parameters */
|
||||||
double (*index_build_range_scan) (Relation table_rel,
|
double (*index_build_range_scan) (Relation table_rel,
|
||||||
Relation index_rel,
|
Relation index_rel,
|
||||||
struct IndexInfo *index_info,
|
IndexInfo *index_info,
|
||||||
bool allow_sync,
|
bool allow_sync,
|
||||||
bool anyvisible,
|
bool anyvisible,
|
||||||
bool progress,
|
bool progress,
|
||||||
@@ -703,9 +704,9 @@ typedef struct TableAmRoutine
|
|||||||
/* see table_index_validate_scan for reference about parameters */
|
/* see table_index_validate_scan for reference about parameters */
|
||||||
void (*index_validate_scan) (Relation table_rel,
|
void (*index_validate_scan) (Relation table_rel,
|
||||||
Relation index_rel,
|
Relation index_rel,
|
||||||
struct IndexInfo *index_info,
|
IndexInfo *index_info,
|
||||||
Snapshot snapshot,
|
Snapshot snapshot,
|
||||||
struct ValidateIndexState *state);
|
ValidateIndexState *state);
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------
|
||||||
@@ -821,7 +822,7 @@ typedef struct TableAmRoutine
|
|||||||
* scans. If infeasible to implement, the AM may raise an error.
|
* scans. If infeasible to implement, the AM may raise an error.
|
||||||
*/
|
*/
|
||||||
bool (*scan_sample_next_block) (TableScanDesc scan,
|
bool (*scan_sample_next_block) (TableScanDesc scan,
|
||||||
struct SampleScanState *scanstate);
|
SampleScanState *scanstate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This callback, only called after scan_sample_next_block has returned
|
* This callback, only called after scan_sample_next_block has returned
|
||||||
@@ -837,7 +838,7 @@ typedef struct TableAmRoutine
|
|||||||
* assumption somehow.
|
* assumption somehow.
|
||||||
*/
|
*/
|
||||||
bool (*scan_sample_next_tuple) (TableScanDesc scan,
|
bool (*scan_sample_next_tuple) (TableScanDesc scan,
|
||||||
struct SampleScanState *scanstate,
|
SampleScanState *scanstate,
|
||||||
TupleTableSlot *slot);
|
TupleTableSlot *slot);
|
||||||
|
|
||||||
} TableAmRoutine;
|
} TableAmRoutine;
|
||||||
@@ -873,7 +874,7 @@ extern TupleTableSlot *table_slot_create(Relation relation, List **reglist);
|
|||||||
*/
|
*/
|
||||||
static inline TableScanDesc
|
static inline TableScanDesc
|
||||||
table_beginscan(Relation rel, Snapshot snapshot,
|
table_beginscan(Relation rel, Snapshot snapshot,
|
||||||
int nkeys, struct ScanKeyData *key)
|
int nkeys, ScanKeyData *key)
|
||||||
{
|
{
|
||||||
uint32 flags = SO_TYPE_SEQSCAN |
|
uint32 flags = SO_TYPE_SEQSCAN |
|
||||||
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
|
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
|
||||||
@@ -886,7 +887,7 @@ table_beginscan(Relation rel, Snapshot snapshot,
|
|||||||
* snapshot appropriate for scanning catalog relations.
|
* snapshot appropriate for scanning catalog relations.
|
||||||
*/
|
*/
|
||||||
extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
|
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
|
* Like table_beginscan(), but table_beginscan_strat() offers an extended API
|
||||||
@@ -897,7 +898,7 @@ extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
|
|||||||
*/
|
*/
|
||||||
static inline TableScanDesc
|
static inline TableScanDesc
|
||||||
table_beginscan_strat(Relation rel, Snapshot snapshot,
|
table_beginscan_strat(Relation rel, Snapshot snapshot,
|
||||||
int nkeys, struct ScanKeyData *key,
|
int nkeys, ScanKeyData *key,
|
||||||
bool allow_strat, bool allow_sync)
|
bool allow_strat, bool allow_sync)
|
||||||
{
|
{
|
||||||
uint32 flags = SO_TYPE_SEQSCAN | SO_ALLOW_PAGEMODE;
|
uint32 flags = SO_TYPE_SEQSCAN | SO_ALLOW_PAGEMODE;
|
||||||
@@ -918,7 +919,7 @@ table_beginscan_strat(Relation rel, Snapshot snapshot,
|
|||||||
*/
|
*/
|
||||||
static inline TableScanDesc
|
static inline TableScanDesc
|
||||||
table_beginscan_bm(Relation rel, Snapshot snapshot,
|
table_beginscan_bm(Relation rel, Snapshot snapshot,
|
||||||
int nkeys, struct ScanKeyData *key)
|
int nkeys, ScanKeyData *key)
|
||||||
{
|
{
|
||||||
uint32 flags = SO_TYPE_BITMAPSCAN | SO_ALLOW_PAGEMODE;
|
uint32 flags = SO_TYPE_BITMAPSCAN | SO_ALLOW_PAGEMODE;
|
||||||
|
|
||||||
@@ -935,7 +936,7 @@ table_beginscan_bm(Relation rel, Snapshot snapshot,
|
|||||||
*/
|
*/
|
||||||
static inline TableScanDesc
|
static inline TableScanDesc
|
||||||
table_beginscan_sampling(Relation rel, Snapshot snapshot,
|
table_beginscan_sampling(Relation rel, Snapshot snapshot,
|
||||||
int nkeys, struct ScanKeyData *key,
|
int nkeys, ScanKeyData *key,
|
||||||
bool allow_strat, bool allow_sync,
|
bool allow_strat, bool allow_sync,
|
||||||
bool allow_pagemode)
|
bool allow_pagemode)
|
||||||
{
|
{
|
||||||
@@ -990,8 +991,7 @@ table_endscan(TableScanDesc scan)
|
|||||||
* Restart a relation scan.
|
* Restart a relation scan.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
table_rescan(TableScanDesc scan,
|
table_rescan(TableScanDesc scan, ScanKeyData *key)
|
||||||
struct ScanKeyData *key)
|
|
||||||
{
|
{
|
||||||
scan->rs_rd->rd_tableam->scan_rescan(scan, key, false, false, false, false);
|
scan->rs_rd->rd_tableam->scan_rescan(scan, key, false, false, false, false);
|
||||||
}
|
}
|
||||||
@@ -1005,7 +1005,7 @@ table_rescan(TableScanDesc scan,
|
|||||||
* previously selected startblock will be kept.
|
* previously selected startblock will be kept.
|
||||||
*/
|
*/
|
||||||
static inline void
|
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)
|
bool allow_strat, bool allow_sync, bool allow_pagemode)
|
||||||
{
|
{
|
||||||
scan->rs_rd->rd_tableam->scan_rescan(scan, key, true,
|
scan->rs_rd->rd_tableam->scan_rescan(scan, key, true,
|
||||||
@@ -1365,7 +1365,7 @@ table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
|
|||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid,
|
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,
|
rel->rd_tableam->tuple_insert(rel, slot, cid, options,
|
||||||
bistate);
|
bistate);
|
||||||
@@ -1385,7 +1385,7 @@ table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid,
|
|||||||
static inline void
|
static inline void
|
||||||
table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot,
|
table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot,
|
||||||
CommandId cid, int options,
|
CommandId cid, int options,
|
||||||
struct BulkInsertStateData *bistate,
|
BulkInsertStateData *bistate,
|
||||||
uint32 specToken)
|
uint32 specToken)
|
||||||
{
|
{
|
||||||
rel->rd_tableam->tuple_insert_speculative(rel, slot, cid, options,
|
rel->rd_tableam->tuple_insert_speculative(rel, slot, cid, options,
|
||||||
@@ -1420,7 +1420,7 @@ table_tuple_complete_speculative(Relation rel, TupleTableSlot *slot,
|
|||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
table_multi_insert(Relation rel, TupleTableSlot **slots, int nslots,
|
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,
|
rel->rd_tableam->multi_insert(rel, slots, nslots,
|
||||||
cid, options, bistate);
|
cid, options, bistate);
|
||||||
@@ -1743,7 +1743,7 @@ table_scan_analyze_next_tuple(TableScanDesc scan, TransactionId OldestXmin,
|
|||||||
static inline double
|
static inline double
|
||||||
table_index_build_scan(Relation table_rel,
|
table_index_build_scan(Relation table_rel,
|
||||||
Relation index_rel,
|
Relation index_rel,
|
||||||
struct IndexInfo *index_info,
|
IndexInfo *index_info,
|
||||||
bool allow_sync,
|
bool allow_sync,
|
||||||
bool progress,
|
bool progress,
|
||||||
IndexBuildCallback callback,
|
IndexBuildCallback callback,
|
||||||
@@ -1776,7 +1776,7 @@ table_index_build_scan(Relation table_rel,
|
|||||||
static inline double
|
static inline double
|
||||||
table_index_build_range_scan(Relation table_rel,
|
table_index_build_range_scan(Relation table_rel,
|
||||||
Relation index_rel,
|
Relation index_rel,
|
||||||
struct IndexInfo *index_info,
|
IndexInfo *index_info,
|
||||||
bool allow_sync,
|
bool allow_sync,
|
||||||
bool anyvisible,
|
bool anyvisible,
|
||||||
bool progress,
|
bool progress,
|
||||||
@@ -1807,9 +1807,9 @@ table_index_build_range_scan(Relation table_rel,
|
|||||||
static inline void
|
static inline void
|
||||||
table_index_validate_scan(Relation table_rel,
|
table_index_validate_scan(Relation table_rel,
|
||||||
Relation index_rel,
|
Relation index_rel,
|
||||||
struct IndexInfo *index_info,
|
IndexInfo *index_info,
|
||||||
Snapshot snapshot,
|
Snapshot snapshot,
|
||||||
struct ValidateIndexState *state)
|
ValidateIndexState *state)
|
||||||
{
|
{
|
||||||
table_rel->rd_tableam->index_validate_scan(table_rel,
|
table_rel->rd_tableam->index_validate_scan(table_rel,
|
||||||
index_rel,
|
index_rel,
|
||||||
@@ -1963,7 +1963,7 @@ table_scan_bitmap_next_tuple(TableScanDesc scan,
|
|||||||
*/
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
table_scan_sample_next_block(TableScanDesc scan,
|
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
|
* We don't expect direct calls to table_scan_sample_next_block with valid
|
||||||
@@ -1985,7 +1985,7 @@ table_scan_sample_next_block(TableScanDesc scan,
|
|||||||
*/
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
table_scan_sample_next_tuple(TableScanDesc scan,
|
table_scan_sample_next_tuple(TableScanDesc scan,
|
||||||
struct SampleScanState *scanstate,
|
SampleScanState *scanstate,
|
||||||
TupleTableSlot *slot)
|
TupleTableSlot *slot)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1656,14 +1656,14 @@ typedef struct SampleScanState
|
|||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct ScanKeyData *scan_key; /* scankey to put value into */
|
ScanKeyData *scan_key; /* scankey to put value into */
|
||||||
ExprState *key_expr; /* expr to evaluate to get value */
|
ExprState *key_expr; /* expr to evaluate to get value */
|
||||||
bool key_toastable; /* is expr's result a toastable datatype? */
|
bool key_toastable; /* is expr's result a toastable datatype? */
|
||||||
} IndexRuntimeKeyInfo;
|
} IndexRuntimeKeyInfo;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct ScanKeyData *scan_key; /* scankey to put value into */
|
ScanKeyData *scan_key; /* scankey to put value into */
|
||||||
ExprState *array_expr; /* expr to evaluate to get array value */
|
ExprState *array_expr; /* expr to evaluate to get array value */
|
||||||
int next_elem; /* next array element to use */
|
int next_elem; /* next array element to use */
|
||||||
int num_elems; /* number of elems in current array value */
|
int num_elems; /* number of elems in current array value */
|
||||||
@@ -1704,9 +1704,9 @@ typedef struct IndexScanState
|
|||||||
ScanState ss; /* its first field is NodeTag */
|
ScanState ss; /* its first field is NodeTag */
|
||||||
ExprState *indexqualorig;
|
ExprState *indexqualorig;
|
||||||
List *indexorderbyorig;
|
List *indexorderbyorig;
|
||||||
struct ScanKeyData *iss_ScanKeys;
|
ScanKeyData *iss_ScanKeys;
|
||||||
int iss_NumScanKeys;
|
int iss_NumScanKeys;
|
||||||
struct ScanKeyData *iss_OrderByKeys;
|
ScanKeyData *iss_OrderByKeys;
|
||||||
int iss_NumOrderByKeys;
|
int iss_NumOrderByKeys;
|
||||||
IndexRuntimeKeyInfo *iss_RuntimeKeys;
|
IndexRuntimeKeyInfo *iss_RuntimeKeys;
|
||||||
int iss_NumRuntimeKeys;
|
int iss_NumRuntimeKeys;
|
||||||
@@ -1755,9 +1755,9 @@ typedef struct IndexOnlyScanState
|
|||||||
{
|
{
|
||||||
ScanState ss; /* its first field is NodeTag */
|
ScanState ss; /* its first field is NodeTag */
|
||||||
ExprState *recheckqual;
|
ExprState *recheckqual;
|
||||||
struct ScanKeyData *ioss_ScanKeys;
|
ScanKeyData *ioss_ScanKeys;
|
||||||
int ioss_NumScanKeys;
|
int ioss_NumScanKeys;
|
||||||
struct ScanKeyData *ioss_OrderByKeys;
|
ScanKeyData *ioss_OrderByKeys;
|
||||||
int ioss_NumOrderByKeys;
|
int ioss_NumOrderByKeys;
|
||||||
IndexRuntimeKeyInfo *ioss_RuntimeKeys;
|
IndexRuntimeKeyInfo *ioss_RuntimeKeys;
|
||||||
int ioss_NumRuntimeKeys;
|
int ioss_NumRuntimeKeys;
|
||||||
@@ -1796,7 +1796,7 @@ typedef struct BitmapIndexScanState
|
|||||||
{
|
{
|
||||||
ScanState ss; /* its first field is NodeTag */
|
ScanState ss; /* its first field is NodeTag */
|
||||||
TIDBitmap *biss_result;
|
TIDBitmap *biss_result;
|
||||||
struct ScanKeyData *biss_ScanKeys;
|
ScanKeyData *biss_ScanKeys;
|
||||||
int biss_NumScanKeys;
|
int biss_NumScanKeys;
|
||||||
IndexRuntimeKeyInfo *biss_RuntimeKeys;
|
IndexRuntimeKeyInfo *biss_RuntimeKeys;
|
||||||
int biss_NumRuntimeKeys;
|
int biss_NumRuntimeKeys;
|
||||||
|
|||||||
Reference in New Issue
Block a user