From fc6d1006bda783cc002c61a5f072905849dbde4b Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 17 Nov 2011 21:31:29 -0500 Subject: Further consolidation of DROP statement handling. This gets rid of an impressive amount of duplicative code, with only minimal behavior changes. DROP FOREIGN DATA WRAPPER now requires object ownership rather than superuser privileges, matching the documentation we already have. We also eliminate the historical warning about dropping a built-in function as unuseful. All operations are now performed in the same order for all object types handled by dropcmds.c. KaiGai Kohei, with minor revisions by me --- src/backend/commands/proclang.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/backend/commands/proclang.c') diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index 7a37e96c402..e4cd2ab33d1 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -507,43 +507,6 @@ PLTemplateExists(const char *languageName) return (find_language_template(languageName) != NULL); } - -/* --------------------------------------------------------------------- - * DROP PROCEDURAL LANGUAGE - * --------------------------------------------------------------------- - */ -void -DropProceduralLanguage(DropPLangStmt *stmt) -{ - Oid oid; - ObjectAddress object; - - oid = get_language_oid(stmt->plname, stmt->missing_ok); - if (!OidIsValid(oid)) - { - ereport(NOTICE, - (errmsg("language \"%s\" does not exist, skipping", - stmt->plname))); - return; - } - - /* - * Check permission - */ - if (!pg_language_ownercheck(oid, GetUserId())) - aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_LANGUAGE, - stmt->plname); - - object.classId = LanguageRelationId; - object.objectId = oid; - object.objectSubId = 0; - - /* - * Do the deletion - */ - performDeletion(&object, stmt->behavior); -} - /* * Guts of language dropping. */ -- cgit v1.2.3