summaryrefslogtreecommitdiffstats
path: root/contrib/pgstattuple/pgstatindex.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--contrib/pgstattuple/pgstatindex.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c
index 9bf14ea..0bd1a01 100644
--- a/contrib/pgstattuple/pgstatindex.c
+++ b/contrib/pgstattuple/pgstatindex.c
@@ -600,10 +600,9 @@ pgstathashindex(PG_FUNCTION_ARGS)
float8 free_percent;
uint64 total_space;
- rel = index_open(relid, AccessShareLock);
+ rel = relation_open(relid, AccessShareLock);
- /* index_open() checks that it's an index */
- if (!IS_HASH(rel))
+ if (!IS_INDEX(rel) || !IS_HASH(rel))
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("relation \"%s\" is not a hash index",