aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-01-31 18:42:24 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-01-31 18:42:24 -0300
commit2f5c9d9c9cec436e55847ec580606d7e88067df6 (patch)
treeec1776d80b7ae8a7b4b0ba357d78eab660dc0f12 /src/backend/utils/cache
parente2090d9d20d8091c9478a674d9c22fc8006909ce (diff)
downloadpostgresql-2f5c9d9c9cec436e55847ec580606d7e88067df6.tar.gz
postgresql-2f5c9d9c9cec436e55847ec580606d7e88067df6.zip
Tweak catalog indexing abstraction for upcoming WARM
Split the existing CatalogUpdateIndexes into two different routines, CatalogTupleInsert and CatalogTupleUpdate, which do both the heap insert/update plus the index update. This removes over 300 lines of boilerplate code all over src/backend/catalog/ and src/backend/commands. The resulting code is much more pleasing to the eye. Also, by encapsulating what happens in detail during an UPDATE, this facilitates the upcoming WARM patch, which is going to add a few more lines to the update case making the boilerplate even more boring. The original CatalogUpdateIndexes is removed; there was only one use left, and since it's just three lines, we can as well expand it in place there. We could keep it, but WARM is going to break all the UPDATE out-of-core callsites anyway, so there seems to be no benefit in doing so. Author: Pavan Deolasee Discussion: https://www.postgr.es/m/CABOikdOcFYSZ4vA2gYfs=M2cdXzXX4qGHeEiW3fu9PCfkHLa2A@mail.gmail.com
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/relcache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 26ff7e187a2..8a7c560e46c 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -3484,8 +3484,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence,
classform->relminmxid = minmulti;
classform->relpersistence = persistence;
- simple_heap_update(pg_class, &tuple->t_self, tuple);
- CatalogUpdateIndexes(pg_class, tuple);
+ CatalogTupleUpdate(pg_class, &tuple->t_self, tuple);
heap_freetuple(tuple);