OSDN Git Service

Update pg_bigm so that it can work with PostgreSQL 12dev.
authorMasaoFujii <masao.fujii@gmail.com>
Mon, 8 Apr 2019 08:49:39 +0000 (17:49 +0900)
committerMasaoFujii <masao.fujii@gmail.com>
Tue, 1 Oct 2019 12:38:13 +0000 (21:38 +0900)
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

index c4853ce..7818bf8 100644 (file)
@@ -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,