From 773dc5349d73af344743236bc741915556f83766 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 25 Apr 2017 12:41:14 +0100 Subject: [PATCH] Work around CatalogIndexInsert no more exported in PG 10 The CatalogTupleUpdateWithInfo performs the two operation simple_heap_update and CatalogIndexInsert. --- lib/repack.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/repack.c b/lib/repack.c index 6ba7535..43f7e80 100644 --- a/lib/repack.c +++ b/lib/repack.c @@ -1156,14 +1156,25 @@ swap_heap_or_index_files(Oid r1, Oid r2) relform2->reltuples = swap_tuples; } + indstate = CatalogOpenIndexes(relRelation); + +#if PG_VERSION_NUM < 100000 + /* Update the tuples in pg_class */ simple_heap_update(relRelation, &reltup1->t_self, reltup1); simple_heap_update(relRelation, &reltup2->t_self, reltup2); /* Keep system catalogs current */ - indstate = CatalogOpenIndexes(relRelation); CatalogIndexInsert(indstate, reltup1); CatalogIndexInsert(indstate, reltup2); + +#else + + CatalogTupleUpdateWithInfo(relRelation, &reltup1->t_self, reltup1, indstate); + CatalogTupleUpdateWithInfo(relRelation, &reltup2->t_self, reltup2, indstate); + +#endif + CatalogCloseIndexes(indstate); /*