Skip to content

Commit 3fbd4bb

Browse files
committed
Refactor DROP LANGUAGE grammar
Fold it into the generic DropStmt. Discussion: https://www.postgresql.org/message-id/flat/163c00a5-f634-ca52-fc7c-0e53deda8735%402ndquadrant.com
1 parent 5333e01 commit 3fbd4bb

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/backend/parser/gram.y

+2-25
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
272272
CreateAssertionStmt CreateTransformStmt CreateTrigStmt CreateEventTrigStmt
273273
CreateUserStmt CreateUserMappingStmt CreateRoleStmt CreatePolicyStmt
274274
CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt
275-
DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt
275+
DropOpClassStmt DropOpFamilyStmt DropStmt
276276
DropCastStmt DropRoleStmt
277277
DropdbStmt DropTableSpaceStmt
278278
DropTransformStmt
@@ -921,7 +921,6 @@ stmt :
921921
| DropOpClassStmt
922922
| DropOpFamilyStmt
923923
| DropOwnedStmt
924-
| DropPLangStmt
925924
| DropStmt
926925
| DropSubscriptionStmt
927926
| DropTableSpaceStmt
@@ -4404,29 +4403,6 @@ opt_validator:
44044403
| /*EMPTY*/ { $$ = NIL; }
44054404
;
44064405

4407-
DropPLangStmt:
4408-
DROP opt_procedural LANGUAGE name opt_drop_behavior
4409-
{
4410-
DropStmt *n = makeNode(DropStmt);
4411-
n->removeType = OBJECT_LANGUAGE;
4412-
n->objects = list_make1(makeString($4));
4413-
n->behavior = $5;
4414-
n->missing_ok = false;
4415-
n->concurrent = false;
4416-
$$ = (Node *)n;
4417-
}
4418-
| DROP opt_procedural LANGUAGE IF_P EXISTS name opt_drop_behavior
4419-
{
4420-
DropStmt *n = makeNode(DropStmt);
4421-
n->removeType = OBJECT_LANGUAGE;
4422-
n->objects = list_make1(makeString($6));
4423-
n->behavior = $7;
4424-
n->missing_ok = true;
4425-
n->concurrent = false;
4426-
$$ = (Node *)n;
4427-
}
4428-
;
4429-
44304406
opt_procedural:
44314407
PROCEDURAL {}
44324408
| /*EMPTY*/ {}
@@ -6359,6 +6335,7 @@ drop_type_name:
63596335
| EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; }
63606336
| EXTENSION { $$ = OBJECT_EXTENSION; }
63616337
| FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; }
6338+
| opt_procedural LANGUAGE { $$ = OBJECT_LANGUAGE; }
63626339
| PUBLICATION { $$ = OBJECT_PUBLICATION; }
63636340
| SCHEMA { $$ = OBJECT_SCHEMA; }
63646341
| SERVER { $$ = OBJECT_FOREIGN_SERVER; }

0 commit comments

Comments
 (0)