summaryrefslogtreecommitdiff
path: root/src/backend/commands/seclabel.c
diff options
context:
space:
mode:
authorTom Lane2017-02-01 21:13:30 +0000
committerTom Lane2017-02-01 21:13:30 +0000
commitab02896510e26e46b830c87eef2c03dd3c52c09e (patch)
tree7fa1029a989330f411bae9b018f1350ccefc90ac /src/backend/commands/seclabel.c
parentbbd8550bce146f86e5e883f1232292a975c314fb (diff)
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/[email protected]
Diffstat (limited to 'src/backend/commands/seclabel.c')
-rw-r--r--src/backend/commands/seclabel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 506c90f6e25..422da8b6b06 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -293,7 +293,7 @@ SetSharedSecurityLabel(const ObjectAddress *object,
if (HeapTupleIsValid(oldtup))
{
if (label == NULL)
- simple_heap_delete(pg_shseclabel, &oldtup->t_self);
+ CatalogTupleDelete(pg_shseclabel, &oldtup->t_self);
else
{
replaces[Anum_pg_shseclabel_label - 1] = true;
@@ -380,7 +380,7 @@ SetSecurityLabel(const ObjectAddress *object,
if (HeapTupleIsValid(oldtup))
{
if (label == NULL)
- simple_heap_delete(pg_seclabel, &oldtup->t_self);
+ CatalogTupleDelete(pg_seclabel, &oldtup->t_self);
else
{
replaces[Anum_pg_seclabel_label - 1] = true;
@@ -432,7 +432,7 @@ DeleteSharedSecurityLabel(Oid objectId, Oid classId)
scan = systable_beginscan(pg_shseclabel, SharedSecLabelObjectIndexId, true,
NULL, 2, skey);
while (HeapTupleIsValid(oldtup = systable_getnext(scan)))
- simple_heap_delete(pg_shseclabel, &oldtup->t_self);
+ CatalogTupleDelete(pg_shseclabel, &oldtup->t_self);
systable_endscan(scan);
heap_close(pg_shseclabel, RowExclusiveLock);
@@ -483,7 +483,7 @@ DeleteSecurityLabel(const ObjectAddress *object)
scan = systable_beginscan(pg_seclabel, SecLabelObjectIndexId, true,
NULL, nkeys, skey);
while (HeapTupleIsValid(oldtup = systable_getnext(scan)))
- simple_heap_delete(pg_seclabel, &oldtup->t_self);
+ CatalogTupleDelete(pg_seclabel, &oldtup->t_self);
systable_endscan(scan);
heap_close(pg_seclabel, RowExclusiveLock);