summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/hashfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pageinspect/hashfuncs.c')
-rw-r--r--contrib/pageinspect/hashfuncs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c
index 090eba4a93..ff73c363fc 100644
--- a/contrib/pageinspect/hashfuncs.c
+++ b/contrib/pageinspect/hashfuncs.c
@@ -417,8 +417,10 @@ hash_bitmap_info(PG_FUNCTION_ARGS)
indexRel = index_open(indexRelid, AccessShareLock);
if (!IS_HASH(indexRel))
- elog(ERROR, "relation \"%s\" is not a hash index",
- RelationGetRelationName(indexRel));
+ ereport(ERROR,
+ (errcode(ERRCODE_WRONG_OBJECT_TYPE),
+ errmsg("\"%s\" is not a %s index",
+ RelationGetRelationName(indexRel), "hash")));
if (RELATION_IS_OTHER_TEMP(indexRel))
ereport(ERROR,