From ab02896510e26e46b830c87eef2c03dd3c52c09e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 1 Feb 2017 16:13:30 -0500 Subject: 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 --- src/backend/commands/dbcommands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/commands/dbcommands.c') diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index c3eb3c79df4..30000a1eeb8 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -895,7 +895,7 @@ dropdb(const char *dbname, bool missing_ok) if (!HeapTupleIsValid(tup)) elog(ERROR, "cache lookup failed for database %u", db_id); - simple_heap_delete(pgdbrel, &tup->t_self); + CatalogTupleDelete(pgdbrel, &tup->t_self); ReleaseSysCache(tup); -- cgit v1.2.3