summaryrefslogtreecommitdiff
path: root/src/backend/catalog/pg_conversion.c
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/catalog/pg_conversion.c
parente2090d9d20d8091c9478a674d9c22fc8006909ce (diff)
downloadpostgresql-2f5c9d9c9cec436e55847ec580606d7e88067df6.tar.gz
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/catalog/pg_conversion.c')
-rw-r--r--src/backend/catalog/pg_conversion.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/backend/catalog/pg_conversion.c b/src/backend/catalog/pg_conversion.c
index adaf7b8ee6..d1e2b93086 100644
--- a/src/backend/catalog/pg_conversion.c
+++ b/src/backend/catalog/pg_conversion.c
@@ -105,10 +105,7 @@ ConversionCreate(const char *conname, Oid connamespace,
tup = heap_form_tuple(tupDesc, values, nulls);
/* insert a new tuple */
- simple_heap_insert(rel, tup);
-
- /* update the index if any */
- CatalogUpdateIndexes(rel, tup);
+ CatalogTupleInsert(rel, tup);
myself.classId = ConversionRelationId;
myself.objectId = HeapTupleGetOid(tup);