(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser to use raw page functions")));
+ /*
+ * This uses relation_open() and not index_open(). The latter allows
+ * partitioned indexes, and these are forbidden here.
+ */
indexRel = relation_open(indexRelid, AccessShareLock);
if (!IS_INDEX(indexRel) || !IS_HASH(indexRel))
bit = ISSET(freep, bitmapbit) != 0;
_hash_relbuf(indexRel, mapbuf);
- index_close(indexRel, AccessShareLock);
+ relation_close(indexRel, AccessShareLock);
/* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupleDesc) != TYPEFUNC_COMPOSITE)
bool nulls[3] = {false, false, false};
Datum result;
+ /*
+ * This uses relation_open() and not index_open(). The latter allows
+ * partitioned indexes, and these are forbidden here.
+ */
rel = relation_open(relid, AccessShareLock);
if (!IS_INDEX(rel) || !IS_GIN(rel))
float8 free_percent;
uint64 total_space;
+ /*
+ * This uses relation_open() and not index_open(). The latter allows
+ * partitioned indexes, and these are forbidden here.
+ */
rel = relation_open(relid, AccessShareLock);
if (!IS_INDEX(rel) || !IS_HASH(rel))
}
/* Done accessing the index */
- index_close(rel, AccessShareLock);
+ relation_close(rel, AccessShareLock);
/* Count unused pages as free space. */
stats.free_space += (uint64) stats.unused_pages * stats.space_per_page;