agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
Subject: [PATCH 6/6] Combine DROP FDW and DROP SERVER grammar into generic DropStmt
Date: Wed, 28 Dec 2016 12:00:00 -0500
---
doc/src/sgml/ref/drop_foreign_data_wrapper.sgml | 2 +-
doc/src/sgml/ref/drop_server.sgml | 2 +-
src/backend/parser/gram.y | 66 ++-----------------------
3 files changed, 6 insertions(+), 64 deletions(-)
diff --git a/doc/src/sgml/ref/drop_foreign_data_wrapper.sgml b/doc/src/sgml/ref/drop_foreign_data_wrapper.sgml
index 824d72c176..702cc021db 100644
--- a/doc/src/sgml/ref/drop_foreign_data_wrapper.sgml
+++ b/doc/src/sgml/ref/drop_foreign_data_wrapper.sgml
@@ -21,7 +21,7 @@
<refsynopsisdiv>
<synopsis>
-DROP FOREIGN DATA WRAPPER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ CASCADE | RESTRICT ]
+DROP FOREIGN DATA WRAPPER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
</synopsis>
</refsynopsisdiv>
diff --git a/doc/src/sgml/ref/drop_server.sgml b/doc/src/sgml/ref/drop_server.sgml
index f08dd7767d..42acdd41dc 100644
--- a/doc/src/sgml/ref/drop_server.sgml
+++ b/doc/src/sgml/ref/drop_server.sgml
@@ -21,7 +21,7 @@
<refsynopsisdiv>
<synopsis>
-DROP SERVER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ CASCADE | RESTRICT ]
+DROP SERVER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
</synopsis>
</refsynopsisdiv>
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 1eacdf1e82..7a9f76151d 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -255,9 +255,9 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt
DropGroupStmt DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt
DropAssertStmt DropTrigStmt DropRuleStmt DropCastStmt DropRoleStmt
- DropPolicyStmt DropUserStmt DropdbStmt DropTableSpaceStmt DropFdwStmt
+ DropPolicyStmt DropUserStmt DropdbStmt DropTableSpaceStmt
DropTransformStmt
- DropForeignServerStmt DropUserMappingStmt ExplainStmt FetchStmt
+ DropUserMappingStmt ExplainStmt FetchStmt
GrantStmt GrantRoleStmt ImportForeignSchemaStmt IndexStmt InsertStmt
ListenStmt LoadStmt LockStmt NotifyStmt ExplainableStmt PreparableStmt
CreateFunctionStmt AlterFunctionStmt ReindexStmt RemoveAggrStmt
@@ -850,8 +850,6 @@ stmt :
| DoStmt
| DropAssertStmt
| DropCastStmt
- | DropFdwStmt
- | DropForeignServerStmt
| DropGroupStmt
| DropOpClassStmt
| DropOpFamilyStmt
@@ -4476,35 +4474,6 @@ opt_fdw_options:
/*****************************************************************************
*
* QUERY :
- * DROP FOREIGN DATA WRAPPER name
- *
- ****************************************************************************/
-
-DropFdwStmt: DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior
- {
- DropStmt *n = makeNode(DropStmt);
- n->removeType = OBJECT_FDW;
- n->objects = list_make1(makeString($5));
- n->missing_ok = false;
- n->behavior = $6;
- n->concurrent = false;
- $$ = (Node *) n;
- }
- | DROP FOREIGN DATA_P WRAPPER IF_P EXISTS name opt_drop_behavior
- {
- DropStmt *n = makeNode(DropStmt);
- n->removeType = OBJECT_FDW;
- n->objects = list_make1(makeString($7));
- n->missing_ok = true;
- n->behavior = $8;
- n->concurrent = false;
- $$ = (Node *) n;
- }
- ;
-
-/*****************************************************************************
- *
- * QUERY :
* ALTER FOREIGN DATA WRAPPER name options
*
****************************************************************************/
@@ -4636,35 +4605,6 @@ opt_foreign_server_version:
/*****************************************************************************
*
* QUERY :
- * DROP SERVER name
- *
- ****************************************************************************/
-
-DropForeignServerStmt: DROP SERVER name opt_drop_behavior
- {
- DropStmt *n = makeNode(DropStmt);
- n->removeType = OBJECT_FOREIGN_SERVER;
- n->objects = list_make1(makeString($3));
- n->missing_ok = false;
- n->behavior = $4;
- n->concurrent = false;
- $$ = (Node *) n;
- }
- | DROP SERVER IF_P EXISTS name opt_drop_behavior
- {
- DropStmt *n = makeNode(DropStmt);
- n->removeType = OBJECT_FOREIGN_SERVER;
- n->objects = list_make1(makeString($5));
- n->missing_ok = true;
- n->behavior = $6;
- n->concurrent = false;
- $$ = (Node *) n;
- }
- ;
-
-/*****************************************************************************
- *
- * QUERY :
* ALTER SERVER name [VERSION] [OPTIONS]
*
****************************************************************************/
@@ -6052,7 +5992,9 @@ drop_type1: TABLE { $$ = OBJECT_TABLE; }
drop_type2: ACCESS METHOD { $$ = OBJECT_ACCESS_METHOD; }
| EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; }
| EXTENSION { $$ = OBJECT_EXTENSION; }
+ | FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; }
| SCHEMA { $$ = OBJECT_SCHEMA; }
+ | SERVER { $$ = OBJECT_FOREIGN_SERVER; }
;
any_name_list:
--
2.11.0
--------------2E97634B6ED7BF4B26D4732D
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
--------------2E97634B6ED7BF4B26D4732D--
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH 6/6] Combine DROP FDW and DROP SERVER grammar into generic DropStmt
In-Reply-To: <no-message-id-296543@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox