From: Shigeru Hanada Date: Fri, 3 Jun 2011 08:28:38 +0000 (+0900) Subject: Add opt_create_generic_options to gram.y for optional usage to make it X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=f1fe50b0b02454474d149e1997521a013b785b39;p=users%2Fhanada%2Fpostgres.git Add opt_create_generic_options to gram.y for optional usage to make it consistent with other elements. --- diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 62cff8a7de..c7e5c42f50 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -319,6 +319,7 @@ static void processCASbits(int cas_bits, int location, const char *constrType, prep_type_clause execute_param_clause using_clause returning_clause opt_enum_val_list enum_val_list table_func_column_list + opt_create_generic_options create_generic_options alter_generic_options relation_expr_list dostmt_opt_list @@ -3600,7 +3601,7 @@ AlterExtensionContentsStmt: * *****************************************************************************/ -CreateFdwStmt: CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options +CreateFdwStmt: CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options opt_create_generic_options { CreateFdwStmt *n = makeNode(CreateFdwStmt); n->fdwname = $5; @@ -3678,9 +3679,13 @@ AlterFdwStmt: ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_op ; /* Options definition for CREATE FDW, SERVER and USER MAPPING */ +opt_create_generic_options: + create_generic_options { $$ = $1 } + | /*EMPTY*/ { $$ = NIL } + ; + create_generic_options: OPTIONS '(' generic_option_list ')' { $$ = $3; } - | /*EMPTY*/ { $$ = NIL; } ; generic_option_list: @@ -3755,7 +3760,7 @@ generic_option_arg: *****************************************************************************/ CreateForeignServerStmt: CREATE SERVER name opt_type opt_foreign_server_version - FOREIGN DATA_P WRAPPER name create_generic_options + FOREIGN DATA_P WRAPPER name opt_create_generic_options { CreateForeignServerStmt *n = makeNode(CreateForeignServerStmt); n->servername = $3; @@ -3851,7 +3856,7 @@ AlterForeignServerStmt: ALTER SERVER name foreign_server_version alter_generic_o CreateForeignTableStmt: CREATE FOREIGN TABLE qualified_name OptForeignTableElementList - SERVER name create_generic_options + SERVER name opt_create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $4->relpersistence = RELPERSISTENCE_PERMANENT; @@ -3866,7 +3871,7 @@ CreateForeignTableStmt: } | CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name OptForeignTableElementList - SERVER name create_generic_options + SERVER name opt_create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $7->relpersistence = RELPERSISTENCE_PERMANENT; @@ -3926,7 +3931,7 @@ AlterForeignTableStmt: * *****************************************************************************/ -CreateUserMappingStmt: CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options +CreateUserMappingStmt: CREATE USER MAPPING FOR auth_ident SERVER name opt_create_generic_options { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->username = $5;