#endif
#include "access/heapam.h"
#include "catalog/index.h"
+#if PG_VERSION_NUM >= 90600
+#include <catalog/pg_am.h>
+#endif
#include "miscadmin.h"
#include "storage/lmgr.h"
#include "catalog/namespace.h"
#if PG_VERSION_NUM >= 80300
#include <tsearch/ts_utils.h>
#endif
+#if PG_VERSION_NUM >= 100000
+#include <utils/regproc.h>
+#include <utils/varlena.h>
+#endif
#include <utils/tqual.h>
#include "utils/builtins.h"
#include "utils/lsyscache.h"
int maxlevel;
text *txt;
char *ptr;
- int len;
+ int len;
} IdxInfo;
static Relation checkOpenedRelation(Relation r, Oid PgAmOid);
static Relation
checkOpenedRelation(Relation r, Oid PgAmOid) {
- if ( r->rd_am == NULL )
+ if ( r->rd_index == NULL )
elog(ERROR, "Relation %s.%s is not an index",
get_namespace_name(RelationGetNamespace(r)),
RelationGetRelationName(r)
LockBuffer(st->buffer, GIN_UNLOCK);
#if PG_VERSION_NUM >= 90400
- stack = ginScanBeginPostingTree(&btree, st->index, rootblkno);
+ stack = ginScanBeginPostingTree(&btree, st->index, rootblkno
+#if PG_VERSION_NUM >= 90600
+ , NULL
+#endif
+ );
page = BufferGetPage(stack->buffer);
ItemPointerSetMin(&minItem);
list = GinDataLeafPageGetItems(page, &nlist, minItem);
char *relname=t2c(name);
ScanKeyData key;
#if PG_VERSION_NUM >= 80400
- TIDBitmap *bitmap = tbm_create(work_mem * 1024L);
+ TIDBitmap *bitmap = tbm_create(work_mem * 1024L
+#if PG_VERSION_NUM >= 100000
+ , NULL
+#endif
+ );
#else
#define MAXTIDS 1024
ItemPointerData tids[MAXTIDS];