@@ -263,10 +263,10 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
263
263
CreateUserStmt CreateUserMappingStmt CreateRoleStmt CreatePolicyStmt
264
264
CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt
265
265
DropGroupStmt DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt
266
- DropAssertStmt DropTrigStmt DropRuleStmt DropCastStmt DropRoleStmt
267
- DropPolicyStmt DropUserStmt DropdbStmt DropTableSpaceStmt DropFdwStmt
266
+ DropAssertStmt DropCastStmt DropRoleStmt
267
+ DropUserStmt DropdbStmt DropTableSpaceStmt
268
268
DropTransformStmt
269
- DropForeignServerStmt DropUserMappingStmt ExplainStmt FetchStmt
269
+ DropUserMappingStmt ExplainStmt FetchStmt
270
270
GrantStmt GrantRoleStmt ImportForeignSchemaStmt IndexStmt InsertStmt
271
271
ListenStmt LoadStmt LockStmt NotifyStmt ExplainableStmt PreparableStmt
272
272
CreateFunctionStmt AlterFunctionStmt ReindexStmt RemoveAggrStmt
@@ -440,7 +440,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
440
440
%type <boolean> copy_from opt_program
441
441
442
442
%type <ival> opt_column event cursor_options opt_hold opt_set_data
443
- %type <objtype> drop_type_any_name drop_type_name
443
+ %type <objtype> drop_type_any_name drop_type_name drop_type_name_on_any_name
444
444
comment_type_any_name comment_type_name
445
445
security_label_type_any_name security_label_type_name
446
446
@@ -885,20 +885,15 @@ stmt :
885
885
| DoStmt
886
886
| DropAssertStmt
887
887
| DropCastStmt
888
- | DropFdwStmt
889
- | DropForeignServerStmt
890
888
| DropGroupStmt
891
889
| DropOpClassStmt
892
890
| DropOpFamilyStmt
893
891
| DropOwnedStmt
894
- | DropPolicyStmt
895
892
| DropPLangStmt
896
- | DropRuleStmt
897
893
| DropStmt
898
894
| DropSubscriptionStmt
899
895
| DropTableSpaceStmt
900
896
| DropTransformStmt
901
- | DropTrigStmt
902
897
| DropRoleStmt
903
898
| DropUserStmt
904
899
| DropUserMappingStmt
@@ -4511,35 +4506,6 @@ opt_fdw_options:
4511
4506
| /* EMPTY*/ { $$ = NIL; }
4512
4507
;
4513
4508
4514
- /* ****************************************************************************
4515
- *
4516
- * QUERY :
4517
- * DROP FOREIGN DATA WRAPPER name
4518
- *
4519
- ****************************************************************************/
4520
-
4521
- DropFdwStmt : DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior
4522
- {
4523
- DropStmt *n = makeNode(DropStmt);
4524
- n->removeType = OBJECT_FDW;
4525
- n->objects = list_make1(makeString($5 ));
4526
- n->missing_ok = false ;
4527
- n->behavior = $6 ;
4528
- n->concurrent = false ;
4529
- $$ = (Node *) n;
4530
- }
4531
- | DROP FOREIGN DATA_P WRAPPER IF_P EXISTS name opt_drop_behavior
4532
- {
4533
- DropStmt *n = makeNode(DropStmt);
4534
- n->removeType = OBJECT_FDW;
4535
- n->objects = list_make1(makeString($7 ));
4536
- n->missing_ok = true ;
4537
- n->behavior = $8 ;
4538
- n->concurrent = false ;
4539
- $$ = (Node *) n;
4540
- }
4541
- ;
4542
-
4543
4509
/* ****************************************************************************
4544
4510
*
4545
4511
* QUERY :
@@ -4671,35 +4637,6 @@ opt_foreign_server_version:
4671
4637
| /* EMPTY*/ { $$ = NULL ; }
4672
4638
;
4673
4639
4674
- /* ****************************************************************************
4675
- *
4676
- * QUERY :
4677
- * DROP SERVER name
4678
- *
4679
- ****************************************************************************/
4680
-
4681
- DropForeignServerStmt : DROP SERVER name opt_drop_behavior
4682
- {
4683
- DropStmt *n = makeNode(DropStmt);
4684
- n->removeType = OBJECT_FOREIGN_SERVER;
4685
- n->objects = list_make1(makeString($3 ));
4686
- n->missing_ok = false ;
4687
- n->behavior = $4 ;
4688
- n->concurrent = false ;
4689
- $$ = (Node *) n;
4690
- }
4691
- | DROP SERVER IF_P EXISTS name opt_drop_behavior
4692
- {
4693
- DropStmt *n = makeNode(DropStmt);
4694
- n->removeType = OBJECT_FOREIGN_SERVER;
4695
- n->objects = list_make1(makeString($5 ));
4696
- n->missing_ok = true ;
4697
- n->behavior = $6 ;
4698
- n->concurrent = false ;
4699
- $$ = (Node *) n;
4700
- }
4701
- ;
4702
-
4703
4640
/* ****************************************************************************
4704
4641
*
4705
4642
* QUERY :
@@ -4975,7 +4912,6 @@ AlterUserMappingStmt: ALTER USER MAPPING FOR auth_ident SERVER name alter_generi
4975
4912
* [USING (qual)] [WITH CHECK (with check qual)]
4976
4913
* ALTER POLICY name ON table [TO role, ...]
4977
4914
* [USING (qual)] [WITH CHECK (with check qual)]
4978
- * DROP POLICY name ON table
4979
4915
*
4980
4916
*****************************************************************************/
4981
4917
@@ -5010,29 +4946,6 @@ AlterPolicyStmt:
5010
4946
}
5011
4947
;
5012
4948
5013
- DropPolicyStmt :
5014
- DROP POLICY name ON any_name opt_drop_behavior
5015
- {
5016
- DropStmt *n = makeNode(DropStmt);
5017
- n->removeType = OBJECT_POLICY;
5018
- n->objects = list_make1(lappend($5 , makeString($3 )));
5019
- n->behavior = $6 ;
5020
- n->missing_ok = false ;
5021
- n->concurrent = false ;
5022
- $$ = (Node *) n;
5023
- }
5024
- | DROP POLICY IF_P EXISTS name ON any_name opt_drop_behavior
5025
- {
5026
- DropStmt *n = makeNode(DropStmt);
5027
- n->removeType = OBJECT_POLICY;
5028
- n->objects = list_make1(lappend($7 , makeString($5 )));
5029
- n->behavior = $8 ;
5030
- n->missing_ok = true ;
5031
- n->concurrent = false ;
5032
- $$ = (Node *) n;
5033
- }
5034
- ;
5035
-
5036
4949
RowSecurityOptionalExpr :
5037
4950
USING ' (' a_expr ' )' { $$ = $3 ; }
5038
4951
| /* EMPTY */ { $$ = NULL ; }
@@ -5105,7 +5018,6 @@ CreateAmStmt: CREATE ACCESS METHOD name TYPE_P INDEX HANDLER handler_name
5105
5018
*
5106
5019
* QUERIES :
5107
5020
* CREATE TRIGGER ...
5108
- * DROP TRIGGER ...
5109
5021
*
5110
5022
*****************************************************************************/
5111
5023
@@ -5332,30 +5244,6 @@ ConstraintAttributeElem:
5332
5244
;
5333
5245
5334
5246
5335
- DropTrigStmt :
5336
- DROP TRIGGER name ON any_name opt_drop_behavior
5337
- {
5338
- DropStmt *n = makeNode(DropStmt);
5339
- n->removeType = OBJECT_TRIGGER;
5340
- n->objects = list_make1(lappend($5 , makeString($3 )));
5341
- n->behavior = $6 ;
5342
- n->missing_ok = false ;
5343
- n->concurrent = false ;
5344
- $$ = (Node *) n;
5345
- }
5346
- | DROP TRIGGER IF_P EXISTS name ON any_name opt_drop_behavior
5347
- {
5348
- DropStmt *n = makeNode(DropStmt);
5349
- n->removeType = OBJECT_TRIGGER;
5350
- n->objects = list_make1(lappend($7 , makeString($5 )));
5351
- n->behavior = $8 ;
5352
- n->missing_ok = true ;
5353
- n->concurrent = false ;
5354
- $$ = (Node *) n;
5355
- }
5356
- ;
5357
-
5358
-
5359
5247
/* ****************************************************************************
5360
5248
*
5361
5249
* QUERIES :
@@ -6034,6 +5922,26 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior
6034
5922
n->concurrent = false ;
6035
5923
$$ = (Node *)n;
6036
5924
}
5925
+ | DROP drop_type_name_on_any_name name ON any_name opt_drop_behavior
5926
+ {
5927
+ DropStmt *n = makeNode(DropStmt);
5928
+ n->removeType = $2 ;
5929
+ n->objects = list_make1(lappend($5 , makeString($3 )));
5930
+ n->behavior = $6 ;
5931
+ n->missing_ok = false ;
5932
+ n->concurrent = false ;
5933
+ $$ = (Node *) n;
5934
+ }
5935
+ | DROP drop_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior
5936
+ {
5937
+ DropStmt *n = makeNode(DropStmt);
5938
+ n->removeType = $2 ;
5939
+ n->objects = list_make1(lappend($7 , makeString($5 )));
5940
+ n->behavior = $8 ;
5941
+ n->missing_ok = true ;
5942
+ n->concurrent = false ;
5943
+ $$ = (Node *) n;
5944
+ }
6037
5945
| DROP TYPE_P type_name_list opt_drop_behavior
6038
5946
{
6039
5947
DropStmt *n = makeNode(DropStmt);
@@ -6117,8 +6025,17 @@ drop_type_name:
6117
6025
ACCESS METHOD { $$ = OBJECT_ACCESS_METHOD; }
6118
6026
| EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; }
6119
6027
| EXTENSION { $$ = OBJECT_EXTENSION; }
6028
+ | FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; }
6120
6029
| PUBLICATION { $$ = OBJECT_PUBLICATION; }
6121
6030
| SCHEMA { $$ = OBJECT_SCHEMA; }
6031
+ | SERVER { $$ = OBJECT_FOREIGN_SERVER; }
6032
+ ;
6033
+
6034
+ /* object types attached to a table */
6035
+ drop_type_name_on_any_name :
6036
+ POLICY { $$ = OBJECT_POLICY; }
6037
+ | RULE { $$ = OBJECT_RULE; }
6038
+ | TRIGGER { $$ = OBJECT_TRIGGER; }
6122
6039
;
6123
6040
6124
6041
any_name_list :
@@ -9277,30 +9194,6 @@ opt_instead:
9277
9194
;
9278
9195
9279
9196
9280
- DropRuleStmt :
9281
- DROP RULE name ON any_name opt_drop_behavior
9282
- {
9283
- DropStmt *n = makeNode(DropStmt);
9284
- n->removeType = OBJECT_RULE;
9285
- n->objects = list_make1(lappend($5 , makeString($3 )));
9286
- n->behavior = $6 ;
9287
- n->missing_ok = false ;
9288
- n->concurrent = false ;
9289
- $$ = (Node *) n;
9290
- }
9291
- | DROP RULE IF_P EXISTS name ON any_name opt_drop_behavior
9292
- {
9293
- DropStmt *n = makeNode(DropStmt);
9294
- n->removeType = OBJECT_RULE;
9295
- n->objects = list_make1(lappend($7 , makeString($5 )));
9296
- n->behavior = $8 ;
9297
- n->missing_ok = true ;
9298
- n->concurrent = false ;
9299
- $$ = (Node *) n;
9300
- }
9301
- ;
9302
-
9303
-
9304
9197
/* ****************************************************************************
9305
9198
*
9306
9199
* QUERY:
0 commit comments