40 if (rel->
rd_rel->relpersistence != RELPERSISTENCE_UNLOGGED ||
45 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
46 errmsg(
"cannot verify unlogged index \"%s\" during recovery, skipping",
103 save_sec_context = -1;
129 errmsg(
"could not open parent table of index \"%s\"",
163 if (rel->
rd_rel->relkind != RELKIND_INDEX)
165 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
166 errmsg(
"expected index as targets for verification"),
169 if (rel->
rd_rel->relam != am_id)
171 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
173 errdetail(
"Relation \"%s\" is a %s index.",
178 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
179 errmsg(
"cannot access temporary tables of other sessions"),
180 errdetail(
"Index \"%s\" is associated with temporary relation.",
185 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
186 errmsg(
"cannot check index \"%s\"",
char * get_am_name(Oid amOid)
#define OidIsValid(objectId)
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
int NewGUCNestLevel(void)
void AtEOXact_GUC(bool isCommit, int nestLevel)
Oid IndexGetRelation(Oid indexId, bool missing_ok)
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
#define SECURITY_RESTRICTED_OPERATION
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
void SetUserIdAndSecContext(Oid userid, int sec_context)
int errdetail_relkind_not_supported(char relkind)
#define ERRCODE_UNDEFINED_TABLE
#define RelationGetRelationName(relation)
#define RELATION_IS_OTHER_TEMP(relation)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
void amcheck_lock_relation_and_check(Oid indrelid, Oid am_id, IndexDoCheckCallback check, LOCKMODE lockmode, void *state)
static bool amcheck_index_mainfork_expected(Relation rel)
static bool index_checkable(Relation rel, Oid am_id)
void(* IndexDoCheckCallback)(Relation rel, Relation heaprel, void *state, bool readonly)
bool RecoveryInProgress(void)