aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.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/tablecmds.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/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 764071bd11b..878b48d39ef 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8939,7 +8939,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
foundDep->refobjid == attTup->attcollation))
elog(ERROR, "found unexpected dependency for column");
- simple_heap_delete(depRel, &depTup->t_self);
+ CatalogTupleDelete(depRel, &depTup->t_self);
}
systable_endscan(scan);
@@ -11177,7 +11177,7 @@ RemoveInheritance(Relation child_rel, Relation parent_rel)
inhparent = ((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhparent;
if (inhparent == RelationGetRelid(parent_rel))
{
- simple_heap_delete(catalogRelation, &inheritsTuple->t_self);
+ CatalogTupleDelete(catalogRelation, &inheritsTuple->t_self);
found = true;
break;
}
@@ -11370,7 +11370,7 @@ drop_parent_dependency(Oid relid, Oid refclassid, Oid refobjid)
dep->refobjid == refobjid &&
dep->refobjsubid == 0 &&
dep->deptype == DEPENDENCY_NORMAL)
- simple_heap_delete(catalogRelation, &depTuple->t_self);
+ CatalogTupleDelete(catalogRelation, &depTuple->t_self);
}
systable_endscan(scan);