| 1 |
/*------------------------------------------------------------------------- |
| 2 |
* |
| 3 |
* amcheck.h |
| 4 |
* Shared routines for amcheck verifications. |
| 5 |
* |
| 6 |
* Copyright (c) 2016-2025, PostgreSQL Global Development Group |
| 7 |
* |
| 8 |
* IDENTIFICATION |
| 9 |
* contrib/amcheck/amcheck.h |
| 10 |
* |
| 11 |
*------------------------------------------------------------------------- |
| 12 |
*/ |
| 13 |
#include "storage/bufpage.h" |
| 14 |
#include "storage/lmgr.h" |
| 15 |
#include "storage/lockdefs.h" |
| 16 |
#include "utils/relcache.h" |
| 17 |
#include "miscadmin.h" |
| 18 |
|
| 19 |
/* Typedefs for callback functions for amcheck_lock_relation_and_check */ |
| 20 |
typedef void (*IndexCheckableCallback) (Relation index); |
| 21 |
typedef void (*IndexDoCheckCallback) (Relation rel, |
| 22 |
Relation heaprel, |
| 23 |
void *state, |
| 24 |
bool readonly); |
| 25 |
|
| 26 |
extern void amcheck_lock_relation_and_check(Oid indrelid, |
| 27 |
Oid am_id, |
| 28 |
IndexDoCheckCallback check, |
| 29 |
LOCKMODE lockmode, void *state); |
| 30 |
|
| 31 |
extern bool index_checkable(Relation rel, Oid am_id); |