From 53e844de04a8d272216fa3e9091677342e994ee0 Mon Sep 17 00:00:00 2001 From: MasaoFujii Date: Mon, 8 Apr 2019 17:49:39 +0900 Subject: [PATCH] Update pg_bigm so that it can work with PostgreSQL 12dev. In PostgreSQL 12dev, commit 4b21acf522 moved the declarations of relation_open() and relation_close into access/relation.h. Also commit 578b229718 changed the interface of CreateTemplateTupleDesc(). These changes made pg_bigm fail to be compiled on 12dev. --- bigm_gin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bigm_gin.c b/bigm_gin.c index c4853ce..7818bf8 100644 --- a/bigm_gin.c +++ b/bigm_gin.c @@ -17,6 +17,9 @@ #include "access/gin.h" #include "access/gin_private.h" #include "access/itup.h" +#if PG_VERSION_NUM >= 120000 +#include "access/relation.h" +#endif #include "access/skey.h" #include "access/tuptoaster.h" #include "access/xlog.h" @@ -417,7 +420,11 @@ pg_gin_pending_stats(PG_FUNCTION_ARGS) * Construct a tuple descriptor for the result row. This must match this * function's pg_bigm--x.x.sql entry. */ + #if PG_VERSION_NUM >= 120000 + tupdesc = CreateTemplateTupleDesc(2); +#else tupdesc = CreateTemplateTupleDesc(2, false); +#endif TupleDescInitEntry(tupdesc, (AttrNumber) 1, "pages", INT4OID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 2, -- 2.11.0