@@ -286,7 +286,7 @@ make_name(void)
286
286
%type <str> CreateAsElement OptCreateAs CreateAsList CreateAsStmt
287
287
%type <str> OptUnder key_reference comment_text ConstraintDeferrabilitySpec
288
288
%type <str> key_match ColLabel SpecialRuleRelation ColId columnDef
289
- %type <str> ColConstraint ColConstraintElem
289
+ %type <str> ColConstraint ColConstraintElem drop_type
290
290
%type <str> OptTableElementList OptTableElement TableConstraint
291
291
%type <str> ConstraintElem key_actions ColQualList TokenId DropSchemaStmt
292
292
%type <str> target_list target_el update_target_list alias_clause
@@ -321,7 +321,7 @@ make_name(void)
321
321
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
322
322
%type <str> RuleStmt opt_column opt_name oper_argtypes sysid_clause
323
323
%type <str> MathOp RemoveFuncStmt aggr_argtype for_update_clause
324
- %type <str> RemoveAggrStmt remove_type RemoveStmt ExtendStmt
324
+ %type <str> RemoveAggrStmt ExtendStmt
325
325
%type <str> RemoveOperStmt RenameStmt all_Op user_valid_clause
326
326
%type <str> VariableSetStmt var_value zone_value VariableShowStmt
327
327
%type <str> VariableResetStmt AlterTableStmt DropUserStmt from_list
@@ -434,7 +434,6 @@ stmt: AlterSchemaStmt { output_statement($1, 0, NULL, connection); }
434
434
| RemoveAggrStmt { output_statement($1 ,0 ,NULL , connection); }
435
435
| RemoveOperStmt { output_statement($1 ,0 ,NULL , connection); }
436
436
| RemoveFuncStmt { output_statement($1 ,0 ,NULL , connection); }
437
- | RemoveStmt { output_statement($1 ,0 ,NULL , connection); }
438
437
| RenameStmt { output_statement($1 ,0 ,NULL , connection); }
439
438
| RevokeStmt { output_statement($1 ,0 ,NULL , connection); }
440
439
| OptimizableStmt {
@@ -1553,20 +1552,25 @@ def_arg: func_return{ $$ = $1; }
1553
1552
/* ****************************************************************************
1554
1553
*
1555
1554
*QUERY:
1556
- *drop <relname1> [, <relname2> .. <relnameN> ]
1555
+ *
1556
+ * DROP itemtype itemname [, itemname ...]
1557
1557
*
1558
1558
*****************************************************************************/
1559
1559
1560
- DropStmt :DROP TABLE relation_name_list
1561
- {
1562
- $$ = cat2_str(make_str(" drop table" ),$3 );
1563
- }
1564
- | DROP SEQUENCE relation_name_list
1560
+ DropStmt :DROP drop_type relation_name_list
1565
1561
{
1566
- $$ =cat2_str( make_str(" drop sequence " ) ,$3 );
1562
+ $$ =cat_str( 3 , make_str(" drop" ), $2 ,$3 );
1567
1563
}
1568
1564
;
1569
1565
1566
+ drop_type :TABLE {$$ = make_str(" table" ); }
1567
+ | SEQUENCE {$$ = make_str(" sequence" ); }
1568
+ | VIEW {$$ = make_str(" view" ); }
1569
+ | INDEX {$$ = make_str(" index" ); }
1570
+ | RULE {$$ = make_str(" rule" ); }
1571
+ | TYPE_P {$$ = make_str(" type" ); }
1572
+ ;
1573
+
1570
1574
/* ****************************************************************************
1571
1575
*
1572
1576
* QUERY:
@@ -1985,32 +1989,18 @@ func_return: Typename
1985
1989
*
1986
1990
*QUERY:
1987
1991
*
1988
- *remove function <funcname>
1989
- *(REMOVE FUNCTION "funcname" (arg1, arg2, ...))
1990
- *remove aggregate <aggname>
1991
- *(REMOVE AGGREGATE "aggname" "aggtype")
1992
- *remove operator <opname>
1993
- *(REMOVE OPERATOR "opname" (leftoperand_typ rightoperand_typ))
1994
- *remove type <typename>
1995
- *(REMOVE TYPE "typename")
1996
- *remove rule <rulename>
1997
- *(REMOVE RULE "rulename")
1992
+ * DROP FUNCTION funcname (arg1, arg2, ...)
1993
+ * DROP AGGREGATE aggname aggtype
1994
+ * DROP OPERATOR opname (leftoperand_typ rightoperand_typ)
1998
1995
*
1999
1996
*****************************************************************************/
2000
1997
2001
- RemoveStmt :DROP remove_type name
1998
+ RemoveFuncStmt :DROP FUNCTION func_name func_args
2002
1999
{
2003
- $$ = cat_str(3 , make_str(" drop" ),$2 ,$3 );
2000
+ $$ = cat_str(3 , make_str(" drop function " ),$3 ,$4 );
2004
2001
}
2005
2002
;
2006
2003
2007
- remove_type :TYPE_P {$$ = make_str(" type" ); }
2008
- | INDEX {$$ = make_str(" index" ); }
2009
- | RULE {$$ = make_str(" rule" ); }
2010
- | VIEW {$$ = make_str(" view" ); }
2011
- ;
2012
-
2013
-
2014
2004
RemoveAggrStmt :DROP AGGREGATE name aggr_argtype
2015
2005
{
2016
2006
$$ = cat_str(3 , make_str(" drop aggregate" ),$3 ,$4 );
@@ -2022,13 +2012,6 @@ aggr_argtype: Typename{ $$ = $1; }
2022
2012
;
2023
2013
2024
2014
2025
- RemoveFuncStmt :DROP FUNCTION func_name func_args
2026
- {
2027
- $$ = cat_str(3 , make_str(" drop function" ),$3 ,$4 );
2028
- }
2029
- ;
2030
-
2031
-
2032
2015
RemoveOperStmt :DROP OPERATOR all_Op ' (' oper_argtypes ' )'
2033
2016
{
2034
2017
$$ = cat_str(5 , make_str(" drop operator" ),$3 , make_str(" (" ),$5 , make_str(" )" ));