aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/comment.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-02-01 16:13:30 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-02-01 16:13:30 -0500
commitab02896510e26e46b830c87eef2c03dd3c52c09e (patch)
tree7fa1029a989330f411bae9b018f1350ccefc90ac /src/backend/commands/comment.c
parentbbd8550bce146f86e5e883f1232292a975c314fb (diff)
downloadpostgresql-ab02896510e26e46b830c87eef2c03dd3c52c09e.tar.gz
postgresql-ab02896510e26e46b830c87eef2c03dd3c52c09e.zip
Provide CatalogTupleDelete() as a wrapper around simple_heap_delete().
This extends the work done in commit 2f5c9d9c9 to provide a more nearly complete abstraction layer hiding the details of index updating for catalog changes. That commit only invented abstractions for catalog inserts and updates, leaving nearby code for catalog deletes still calling the heap-level routines directly. That seems rather ugly from here, and it does little to help if we ever want to shift to a storage system in which indexing work is needed at delete time. Hence, create a wrapper function CatalogTupleDelete(), and replace calls of simple_heap_delete() on catalog tuples with it. There are now very few direct calls of [simple_]heap_delete remaining in the tree. Discussion: https://postgr.es/m/462.1485902736@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r--src/backend/commands/comment.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index 8a437de8154..87ca62f2403 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -194,7 +194,7 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
/* Found the old tuple, so delete or update it */
if (comment == NULL)
- simple_heap_delete(description, &oldtuple->t_self);
+ CatalogTupleDelete(description, &oldtuple->t_self);
else
{
newtuple = heap_modify_tuple(oldtuple, RelationGetDescr(description), values,
@@ -284,7 +284,7 @@ CreateSharedComments(Oid oid, Oid classoid, char *comment)
/* Found the old tuple, so delete or update it */
if (comment == NULL)
- simple_heap_delete(shdescription, &oldtuple->t_self);
+ CatalogTupleDelete(shdescription, &oldtuple->t_self);
else
{
newtuple = heap_modify_tuple(oldtuple, RelationGetDescr(shdescription),
@@ -358,7 +358,7 @@ DeleteComments(Oid oid, Oid classoid, int32 subid)
NULL, nkeys, skey);
while ((oldtuple = systable_getnext(sd)) != NULL)
- simple_heap_delete(description, &oldtuple->t_self);
+ CatalogTupleDelete(description, &oldtuple->t_self);
/* Done */
@@ -394,7 +394,7 @@ DeleteSharedComments(Oid oid, Oid classoid)
NULL, 2, skey);
while ((oldtuple = systable_getnext(sd)) != NULL)
- simple_heap_delete(shdescription, &oldtuple->t_self);
+ CatalogTupleDelete(shdescription, &oldtuple->t_self);
/* Done */