summaryrefslogtreecommitdiff
path: root/src/backend/commands/proclang.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-06-09 09:10:14 +0200
committerPeter Eisentraut <peter@eisentraut.org>2020-06-09 09:39:46 +0200
commitb1d32d3e3230f00b5baba08f75b4f665c7d6dac6 (patch)
tree9b0b6bba1aab417382105d09fc2800f346c7ce2b /src/backend/commands/proclang.c
parentb27c90bbe4a3d607f8fc6703c7183e56e4039acd (diff)
Unify drop-by-OID functions
There are a number of Remove${Something}ById() functions that are essentially identical in structure and only different in which catalog they are working on. Refactor this to be one generic function. The information about which oid column, index, etc. to use was already available in ObjectProperty for most catalogs, in a few cases it was easily added. Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/331d9661-1743-857f-1cbb-d5728bcd62cb%402ndquadrant.com
Diffstat (limited to 'src/backend/commands/proclang.c')
-rw-r--r--src/backend/commands/proclang.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c
index 21ceeb7e9a1..14153426bdd 100644
--- a/src/backend/commands/proclang.c
+++ b/src/backend/commands/proclang.c
@@ -219,28 +219,6 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
}
/*
- * Guts of language dropping.
- */
-void
-DropProceduralLanguageById(Oid langOid)
-{
- Relation rel;
- HeapTuple langTup;
-
- rel = table_open(LanguageRelationId, RowExclusiveLock);
-
- langTup = SearchSysCache1(LANGOID, ObjectIdGetDatum(langOid));
- if (!HeapTupleIsValid(langTup)) /* should not happen */
- elog(ERROR, "cache lookup failed for language %u", langOid);
-
- CatalogTupleDelete(rel, &langTup->t_self);
-
- ReleaseSysCache(langTup);
-
- table_close(rel, RowExclusiveLock);
-}
-
-/*
* get_language_oid - given a language name, look up the OID
*
* If missing_ok is false, throw an error if language name not found. If