From 2ead2e207ed7b907f1f2a1b796867b83062dd1f7 Mon Sep 17 00:00:00 2001 From: thoshiai <45982834+thoshiai@users.noreply.github.com> Date: Thu, 14 Jul 2022 22:54:33 +0900 Subject: [PATCH] Add support for PostgreSQL 15 (#15) --- matview.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/matview.c b/matview.c index c2dc85b..dcda7d8 100644 --- a/matview.c +++ b/matview.c @@ -400,8 +400,13 @@ ExecRefreshImmv(const RangeVar *relation, bool skipData, * it against access by any other process until commit (by which time it * will be gone). */ +#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 150000) + OIDNewHeap = make_new_heap(matviewOid, tableSpace, + matviewRel->rd_rel->relam, relpersistence, ExclusiveLock); +#else OIDNewHeap = make_new_heap(matviewOid, tableSpace, relpersistence, ExclusiveLock); +#endif LockRelationOid(OIDNewHeap, AccessExclusiveLock); dest = CreateTransientRelDestReceiver(OIDNewHeap); @@ -893,8 +898,13 @@ IVM_immediate_maintenance(PG_FUNCTION_ARGS) * it against access by any other process until commit (by which time it * will be gone). */ +#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 150000) + OIDNewHeap = make_new_heap(matviewOid, matviewRel->rd_rel->reltablespace, + matviewRel->rd_rel->relam, relpersistence, ExclusiveLock); +#else OIDNewHeap = make_new_heap(matviewOid, matviewRel->rd_rel->reltablespace, relpersistence, ExclusiveLock); +#endif LockRelationOid(OIDNewHeap, AccessExclusiveLock); dest = CreateTransientRelDestReceiver(OIDNewHeap);