diff --git a/sql/postgresql/PostgreSQLLexer.g4 b/sql/postgresql/PostgreSQLLexer.g4 index db8fe0af3c..9a133ba077 100644 --- a/sql/postgresql/PostgreSQLLexer.g4 +++ b/sql/postgresql/PostgreSQLLexer.g4 @@ -213,6 +213,7 @@ UNCONDITIONAL: 'UNCONDITIONAL'; PERIOD: 'PERIOD'; +FORMAT_LA: 'FORMAT_LA'; // @@ -1165,18 +1166,12 @@ NORMALIZE: 'NORMALIZE'; DUMP: 'DUMP'; -PRINT_STRICT_PARAMS: 'PRINT_STRICT_PARAMS'; - -VARIABLE_CONFLICT: 'VARIABLE_CONFLICT'; - ERROR: 'ERROR'; USE_VARIABLE: 'USE_VARIABLE'; USE_COLUMN: 'USE_COLUMN'; -ALIAS: 'ALIAS'; - CONSTANT: 'CONSTANT'; PERFORM: 'PERFORM'; @@ -1201,8 +1196,6 @@ EXIT: 'EXIT'; RETURN: 'RETURN'; -//QUERY: 'QUERY'; - RAISE: 'RAISE'; SQLSTATE: 'SQLSTATE'; diff --git a/sql/postgresql/PostgreSQLParser.g4 b/sql/postgresql/PostgreSQLParser.g4 index 9e07ee6e58..d46a7a70e0 100644 --- a/sql/postgresql/PostgreSQLParser.g4 +++ b/sql/postgresql/PostgreSQLParser.g4 @@ -29,20 +29,10 @@ options { superClass = PostgreSQLParserBase; } -@header { -} - -@members { -} - root : stmtblock EOF ; -plsqlroot - : pl_function - ; - stmtblock : stmtmulti ; @@ -528,7 +518,7 @@ reloption_list ; reloption_elem - : collabel (EQUAL def_arg | DOT collabel (EQUAL def_arg)?)? + : colLabel (EQUAL def_arg | DOT colLabel (EQUAL def_arg)?)? ; alter_identity_column_option_list @@ -639,7 +629,7 @@ copy_generic_opt_list ; copy_generic_opt_elem - : collabel copy_generic_opt_arg? + : colLabel copy_generic_opt_arg? ; copy_generic_opt_arg @@ -1142,7 +1132,7 @@ generic_option_elem ; generic_option_name - : collabel + : colLabel ; generic_option_arg @@ -1354,7 +1344,7 @@ triggerfuncarg : iconst | fconst | sconst - | collabel + | colLabel ; optconstrfromtable @@ -1376,8 +1366,8 @@ constraintattributeElem ; createeventtrigstmt - : CREATE EVENT TRIGGER name ON collabel EXECUTE function_or_procedure func_name OPEN_PAREN CLOSE_PAREN - | CREATE EVENT TRIGGER name ON collabel WHEN event_trigger_when_list EXECUTE function_or_procedure func_name OPEN_PAREN CLOSE_PAREN + : CREATE EVENT TRIGGER name ON colLabel EXECUTE function_or_procedure func_name OPEN_PAREN CLOSE_PAREN + | CREATE EVENT TRIGGER name ON colLabel WHEN event_trigger_when_list EXECUTE function_or_procedure func_name OPEN_PAREN CLOSE_PAREN ; event_trigger_when_list @@ -1435,7 +1425,7 @@ def_list ; def_elem - : collabel (EQUAL def_arg)? + : colLabel (EQUAL def_arg)? ; def_arg @@ -2325,8 +2315,8 @@ operator_def_list ; operator_def_elem - : collabel EQUAL NONE - | collabel EQUAL operator_def_arg + : colLabel EQUAL NONE + | colLabel EQUAL operator_def_arg ; operator_def_arg @@ -2398,7 +2388,7 @@ publication_name_list ; publication_name_item - : collabel + : colLabel ; altersubscriptionstmt @@ -3004,8 +2994,7 @@ with_clause_ ; into_clause - : INTO (strict_? opttempTableName | into_target) - + : INTO opttempTableName ; strict_ @@ -3330,7 +3319,7 @@ xml_namespace_list ; xml_namespace_el - : b_expr AS collabel + : b_expr AS colLabel | DEFAULT b_expr ; @@ -3358,6 +3347,7 @@ consttypename | constbit | constcharacter | constdatetime + | jsonType ; generictype @@ -3749,15 +3739,16 @@ func_expr_common_subexpr | CURRENT_ROLE | CURRENT_USER | SESSION_USER + | SYSTEM_USER | USER | CURRENT_CATALOG | CURRENT_SCHEMA | CAST OPEN_PAREN a_expr AS typename CLOSE_PAREN | EXTRACT OPEN_PAREN extract_list? CLOSE_PAREN | NORMALIZE OPEN_PAREN a_expr (COMMA unicode_normal_form)? CLOSE_PAREN - | OVERLAY OPEN_PAREN overlay_list CLOSE_PAREN + | OVERLAY OPEN_PAREN (overlay_list | func_arg_list? ) CLOSE_PAREN | POSITION OPEN_PAREN position_list? CLOSE_PAREN - | SUBSTRING OPEN_PAREN substr_list CLOSE_PAREN + | SUBSTRING OPEN_PAREN (substr_list | func_arg_list?) CLOSE_PAREN | TREAT OPEN_PAREN a_expr AS typename CLOSE_PAREN | TRIM OPEN_PAREN (BOTH | LEADING | TRAILING)? trim_list CLOSE_PAREN | NULLIF OPEN_PAREN a_expr COMMA a_expr CLOSE_PAREN @@ -3765,14 +3756,52 @@ func_expr_common_subexpr | GREATEST OPEN_PAREN expr_list CLOSE_PAREN | LEAST OPEN_PAREN expr_list CLOSE_PAREN | XMLCONCAT OPEN_PAREN expr_list CLOSE_PAREN - | XMLELEMENT OPEN_PAREN NAME_P collabel (COMMA (xml_attributes | expr_list))? CLOSE_PAREN + | XMLELEMENT OPEN_PAREN NAME_P colLabel (COMMA (xml_attributes | expr_list))? CLOSE_PAREN | XMLEXISTS OPEN_PAREN c_expr xmlexists_argument CLOSE_PAREN | XMLFOREST OPEN_PAREN xml_attribute_list CLOSE_PAREN | XMLPARSE OPEN_PAREN document_or_content a_expr xml_whitespace_option? CLOSE_PAREN - | XMLPI OPEN_PAREN NAME_P collabel (COMMA a_expr)? CLOSE_PAREN + | XMLPI OPEN_PAREN NAME_P colLabel (COMMA a_expr)? CLOSE_PAREN | XMLROOT OPEN_PAREN XML_P a_expr COMMA xml_root_version xml_root_standalone_? CLOSE_PAREN | XMLSERIALIZE OPEN_PAREN document_or_content a_expr AS simpletypename CLOSE_PAREN - ; + | JSON_OBJECT OPEN_PAREN (func_arg_list + | json_name_and_value_list + json_object_constructor_null_clause? + json_key_uniqueness_constraint? + json_returning_clause? + | json_returning_clause? ) + CLOSE_PAREN + | JSON_ARRAY OPEN_PAREN (json_value_expr_list + json_array_constructor_null_clause? + json_returning_clause? + | select_no_parens + json_format_clause? + json_returning_clause? + | json_returning_clause? + ) + CLOSE_PAREN + | JSON '(' json_value_expr json_key_uniqueness_constraint? ')' + | JSON_SCALAR '(' a_expr ')' + | JSON_SERIALIZE '(' json_value_expr json_returning_clause? ')' + | MERGE_ACTION '(' ')' + | JSON_QUERY '(' + json_value_expr ',' a_expr json_passing_clause? + json_returning_clause? + json_wrapper_behavior + json_quotes_clause? + json_behavior_clause? + ')' + | JSON_EXISTS '(' + json_value_expr ',' a_expr json_passing_clause? + json_on_error_clause? + ')' + | JSON_VALUE '(' + json_value_expr ',' a_expr json_passing_clause? + json_returning_clause? + json_behavior_clause? + ')' + ; + +/* SQL/XML support */ xml_root_version : VERSION_P a_expr @@ -3783,7 +3812,6 @@ xml_root_standalone_ : COMMA STANDALONE_P YES_P | COMMA STANDALONE_P NO | COMMA STANDALONE_P NO VALUE_P - ; xml_attributes @@ -3795,7 +3823,7 @@ xml_attribute_list ; xml_attribute_el - : a_expr (AS collabel)? + : a_expr (AS colLabel)? ; document_or_content @@ -4074,6 +4102,163 @@ opt_indirection : indirection_el* ; +/* SQL/JSON support */ +json_passing_clause: + PASSING json_arguments + ; + +json_arguments: + json_argument + | json_arguments ',' json_argument + ; + +json_argument: + json_value_expr AS colLabel + ; + +/* ARRAY is a noise word */ +json_wrapper_behavior: + WITHOUT WRAPPER + | WITHOUT ARRAY WRAPPER + | WITH WRAPPER + | WITH ARRAY WRAPPER + | WITH CONDITIONAL ARRAY WRAPPER + | WITH UNCONDITIONAL ARRAY WRAPPER + | WITH CONDITIONAL WRAPPER + | WITH UNCONDITIONAL WRAPPER + | + ; + +json_behavior: + DEFAULT a_expr + | json_behavior_type + ; + +json_behavior_type: + ERROR + | NULL_P + | TRUE_P + | FALSE_P + | UNKNOWN + | EMPTY_P ARRAY + | EMPTY_P OBJECT_P + /* non-standard, for Oracle compatibility only */ + | EMPTY_P + ; + +json_behavior_clause: + json_behavior ON EMPTY_P + | json_behavior ON ERROR + | json_behavior ON EMPTY_P json_behavior ON ERROR + ; + +json_on_error_clause: + json_behavior ON ERROR + ; + +json_value_expr: + a_expr json_format_clause? + ; + +json_format_clause: + FORMAT_LA JSON ENCODING name + | FORMAT_LA JSON + ; + + +json_quotes_clause: + KEEP QUOTES ON SCALAR STRING_P + | KEEP QUOTES + | OMIT QUOTES ON SCALAR STRING_P + | OMIT QUOTES + ; + +json_returning_clause: + RETURNING typename json_format_clause? + ; + +/* + * We must assign the only-JSON production a precedence less than IDENT in + * order to favor shifting over reduction when JSON is followed by VALUE_P, + * OBJECT_P, or SCALAR. (ARRAY doesn't need that treatment, because it's a + * fully reserved word.) Because json_predicate_type_constraint is always + * followed by json_key_uniqueness_constraint_opt, we also need the only-JSON + * production to have precedence less than WITH and WITHOUT. UNBOUNDED isn't + * really related to this syntax, but it's a convenient choice because it + * already has a precedence less than IDENT for other reasons. + */ +json_predicate_type_constraint: + JSON + | JSON VALUE_P + | JSON ARRAY + | JSON OBJECT_P + | JSON SCALAR + ; + +/* + * KEYS is a noise word here. To avoid shift/reduce conflicts, assign the + * KEYS-less productions a precedence less than IDENT (i.e., less than KEYS). + * This prevents reducing them when the next token is KEYS. + */ +json_key_uniqueness_constraint: + WITH UNIQUE KEYS + | WITH UNIQUE + | WITHOUT UNIQUE KEYS + | WITHOUT UNIQUE + ; + +json_name_and_value_list: + json_name_and_value + | json_name_and_value_list ',' json_name_and_value + ; + +json_name_and_value: + c_expr VALUE_P json_value_expr + | + a_expr ':' json_value_expr + ; + +/* empty means false for objects, true for arrays */ +json_object_constructor_null_clause: + NULL_P ON NULL_P + | ABSENT ON NULL_P + ; + +json_array_constructor_null_clause: + NULL_P ON NULL_P + | ABSENT ON NULL_P + ; + +json_value_expr_list: + json_value_expr + | json_value_expr_list ',' json_value_expr + ; + +json_aggregate_func: + JSON_OBJECTAGG '(' + json_name_and_value + json_object_constructor_null_clause? + json_key_uniqueness_constraint? + json_returning_clause + ')' + | JSON_ARRAYAGG '(' + json_value_expr + json_array_aggregate_order_by_clause? + json_array_constructor_null_clause? + json_returning_clause + ')' + ; + +json_array_aggregate_order_by_clause: + ORDER BY sortby_list + ; + +/***************************************************************************** + * + * target list for SELECT + * + *****************************************************************************/ + target_list_ : target_list @@ -4084,7 +4269,7 @@ target_list ; target_el - : a_expr (AS collabel | identifier |) # target_label + : a_expr (AS colLabel | bareColLabel |) # target_label | STAR # target_star ; @@ -4105,7 +4290,7 @@ name ; attr_name - : collabel + : colLabel ; file_name @@ -4190,7 +4375,6 @@ colid : identifier | unreserved_keyword | col_name_keyword - | QUERY //NB: Non-standard from official source. ; type_function_name @@ -4206,7 +4390,7 @@ nonreservedword | type_func_name_keyword ; -collabel +colLabel : identifier | unreserved_keyword | col_name_keyword @@ -4215,6 +4399,11 @@ collabel | EXIT //NB: not in gram.y official source. ; +bareColLabel + : identifier + | bare_label_keyword + ; + identifier : Identifier uescape_? | QuotedIdentifier @@ -5319,734 +5508,7 @@ builtin_function_name | TO_NUMBER ; -/************************************************************************************************************************************************************/ -/*PL/SQL GRAMMAR */ - -/*PLSQL grammar */ - -/************************************************************************************************************************************************************/ -pl_function - : comp_options pl_block semi_? - ; - -comp_options - : comp_option* - ; - -comp_option - : sharp OPTION DUMP - | sharp PRINT_STRICT_PARAMS option_value - | sharp VARIABLE_CONFLICT ERROR - | sharp VARIABLE_CONFLICT USE_VARIABLE - | sharp VARIABLE_CONFLICT USE_COLUMN - ; - -sharp - : Operator - ; - -option_value - : sconst - | reserved_keyword - | unreserved_keyword - ; - -semi_ - : - SEMI - ; - -// exception_sect means opt_exception_sect in original grammar, don't be confused! - -pl_block - : decl_sect BEGIN_P proc_sect exception_sect? END_P label_? - ; - -decl_sect - : block_label_? (decl_start decl_stmts?)? - ; - -decl_start - : DECLARE - ; - -decl_stmts - : decl_stmt+ - ; - -label_decl - : LESS_LESS any_identifier GREATER_GREATER - ; - -decl_stmt - : decl_statement - | DECLARE - | label_decl - ; - -decl_statement - : decl_varname ( - ALIAS FOR decl_aliasitem - | decl_const? decl_datatype decl_collate? decl_notnull? decl_defval? - | scrollable_? CURSOR decl_cursor_args? decl_is_for decl_cursor_query - ) SEMI - ; - -scrollable_ - : - NO SCROLL - | SCROLL - ; - -decl_cursor_query - : selectstmt - ; - -decl_cursor_args - : - OPEN_PAREN decl_cursor_arglist CLOSE_PAREN - ; - -decl_cursor_arglist - : decl_cursor_arg (COMMA decl_cursor_arg)* - ; - -decl_cursor_arg - : decl_varname decl_datatype - ; - -decl_is_for - : IS - | FOR - ; - -decl_aliasitem - : PARAM - | colid - ; - -decl_varname - : any_identifier - ; - -decl_const - : - CONSTANT - ; - -decl_datatype - : typename - ; //TODO: $$ = read_datatype(yychar); - -decl_collate - : - COLLATE any_name - ; - -decl_notnull - : - NOT NULL_P - ; - -decl_defval - : - decl_defkey sql_expression - ; - -decl_defkey - : assign_operator - | DEFAULT - ; - -assign_operator - : EQUAL - | COLON_EQUALS - ; - -proc_sect - : proc_stmt* - ; - -proc_stmt - : pl_block SEMI - | stmt_return - | stmt_raise - | stmt_assign - | stmt_if - | stmt_case - | stmt_loop - | stmt_while - | stmt_for - | stmt_foreach_a - | stmt_exit - | stmt_assert - | stmt_execsql - | stmt_dynexecute - | stmt_perform - | stmt_call - | stmt_getdiag - | stmt_open - | stmt_fetch - | stmt_move - | stmt_close - | stmt_null - | stmt_commit - | stmt_rollback - | stmt_set - ; - -stmt_perform - : PERFORM expr_until_semi SEMI - ; - -stmt_call - : CALL any_identifier OPEN_PAREN expr_list_? CLOSE_PAREN SEMI - | DO any_identifier OPEN_PAREN expr_list_? CLOSE_PAREN SEMI - ; - -expr_list_ - : - expr_list - ; - -stmt_assign - : assign_var assign_operator sql_expression SEMI - ; - -stmt_getdiag - : GET getdiag_area_opt? DIAGNOSTICS getdiag_list SEMI - ; - -getdiag_area_opt - : - CURRENT_P - | STACKED - ; - -getdiag_list - : getdiag_list_item (COMMA getdiag_list_item)* - ; - -getdiag_list_item - : getdiag_target assign_operator getdiag_item - ; - -getdiag_item - : colid - ; - -getdiag_target - : assign_var - ; - -assign_var - : (any_name | PARAM) (OPEN_BRACKET expr_until_rightbracket CLOSE_BRACKET)* - ; - -stmt_if - : IF_P expr_until_then THEN proc_sect stmt_elsifs stmt_else? END_P IF_P SEMI - ; - -stmt_elsifs - : (ELSIF a_expr THEN proc_sect)* - ; - -stmt_else - : - ELSE proc_sect - ; - -stmt_case - : CASE opt_expr_until_when? case_when_list case_else_? END_P CASE SEMI - ; - -opt_expr_until_when - : - sql_expression - ; - -case_when_list - : case_when+ - ; - -case_when - : WHEN expr_list THEN proc_sect - ; - -case_else_ - : - ELSE proc_sect - ; - -stmt_loop - : loop_label_? loop_body - ; - -stmt_while - : loop_label_? WHILE expr_until_loop loop_body - ; - -stmt_for - : loop_label_? FOR for_control loop_body - ; - -//TODO: rewrite using read_sql_expression logic? - -for_control - : for_variable IN_P ( - cursor_name cursor_parameters_? - | selectstmt - | explainstmt - | EXECUTE a_expr for_using_expression_? - | reverse_? a_expr DOT_DOT a_expr by_expression_? - ) - ; - -for_using_expression_ - : - USING expr_list - ; - -cursor_parameters_ - : - OPEN_PAREN a_expr (COMMA a_expr)* CLOSE_PAREN - ; - -reverse_ - : - REVERSE - ; - -by_expression_ - : - BY a_expr - ; - -for_variable - : any_name_list - ; - -stmt_foreach_a - : loop_label_? FOREACH for_variable foreach_slice? IN_P ARRAY a_expr loop_body - ; - -foreach_slice - : - SLICE iconst - ; - -stmt_exit - : exit_type label_? exitcond_? SEMI - ; - -exit_type - : EXIT - | CONTINUE_P - ; - -//todo implement RETURN statement according to initial grammar line 1754 - -stmt_return - : RETURN ( - NEXT sql_expression - | QUERY (EXECUTE a_expr for_using_expression_? | selectstmt) - | opt_return_result? - ) SEMI - ; - -opt_return_result - : - sql_expression - ; - -//https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html - -//RAISE [ level ] 'format' [, expression [, ... ]] [ USING option = expression [, ... ] ]; - -//RAISE [ level ] condition_name [ USING option = expression [, ... ] ]; - -//RAISE [ level ] SQLSTATE 'sqlstate' [ USING option = expression [, ... ] ]; - -//RAISE [ level ] USING option = expression [, ... ]; - -//RAISE ; - -stmt_raise - : RAISE stmt_raise_level_? sconst raise_list_? raise_using_? SEMI - | RAISE stmt_raise_level_? identifier raise_using_? SEMI - | RAISE stmt_raise_level_? SQLSTATE sconst raise_using_? SEMI - | RAISE stmt_raise_level_? raise_using_? SEMI - | RAISE - ; - -stmt_raise_level_ - : - - DEBUG - | LOG - | INFO - | NOTICE - | WARNING - | EXCEPTION - ; - -raise_list_ - : - (COMMA a_expr)+ - ; - -raise_using_ - : - USING raise_using_elem_list_ - ; - -raise_using_elem_ - : identifier EQUAL a_expr - ; - -raise_using_elem_list_ - : raise_using_elem_ (COMMA raise_using_elem_)* - ; - -//todo imnplement - -stmt_assert - : ASSERT sql_expression stmt_assert_message_? SEMI - ; - -stmt_assert_message_ - : - COMMA sql_expression - ; - -loop_body - : LOOP proc_sect END_P LOOP label_? SEMI - ; - -//TODO: looks like all other statements like INSERT/SELECT/UPDATE/DELETE are handled here; - -//pls take a look at original grammar - -stmt_execsql - : make_execsql_stmt SEMI - /*K_IMPORT - | K_INSERT - | t_word - | t_cword -*/ - ; - -//https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-NORESULT - -//EXECUTE command-string [ INTO [STRICT] target ] [ USING expression [, ... ] ]; - -stmt_dynexecute - : EXECUTE a_expr ( - /*this is silly, but i have to time to find nice way to code */ execute_into_? execute_using_? - | execute_using_? execute_into_? - | - ) SEMI - ; - -execute_using_ - : - USING execute_using_list_ - ; - -execute_using_list_ - : a_expr (COMMA a_expr)* - ; - -execute_into_ - : - INTO STRICT_P? into_target - ; - -//https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING - -//OPEN unbound_cursorvar [ [ NO ] SCROLL ] FOR query; - -//OPEN unbound_cursorvar [ [ NO ] SCROLL ] FOR EXECUTE query_string - -// [ USING expression [, ... ] ]; - -//OPEN bound_cursorvar [ ( [ argument_name := ] argument_value [, ...] ) ]; - -stmt_open - : OPEN ( - cursor_variable scroll_option_? FOR (selectstmt | EXECUTE sql_expression open_using_?) - | colid (OPEN_PAREN open_bound_list_ CLOSE_PAREN)? - ) SEMI - ; - -open_bound_list_item_ - : colid COLON_EQUALS a_expr - | a_expr - ; - -open_bound_list_ - : open_bound_list_item_ (COMMA open_bound_list_item_)* - ; - -open_using_ - : - USING expr_list - ; - -scroll_option_ - : - scroll_option_no_? SCROLL - ; - -scroll_option_no_ - : - NO - ; - -//https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING - -//FETCH [ direction { FROM | IN } ] cursor INTO target; - -stmt_fetch - : FETCH direction = fetch_direction_ cursor_from_? cursor_variable INTO into_target SEMI - ; - -into_target - : expr_list - ; - -cursor_from_ - : - FROM - | IN_P - ; - -fetch_direction_ - : - - NEXT - | PRIOR - | FIRST_P - | LAST_P - | ABSOLUTE_P a_expr - | RELATIVE_P a_expr - | a_expr - | ALL - | (FORWARD | BACKWARD) (a_expr | ALL)? - ; - -//https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING - -//MOVE [ direction { FROM | IN } ] cursor; - -stmt_move - : MOVE fetch_direction_? cursor_variable SEMI - ; - -stmt_close - : CLOSE cursor_variable SEMI - ; - -stmt_null - : NULL_P SEMI - ; - -stmt_commit - : COMMIT plsql_opt_transaction_chain? SEMI - ; - -stmt_rollback - : ROLLBACK plsql_opt_transaction_chain? SEMI - ; - -plsql_opt_transaction_chain - : AND NO? CHAIN - - ; - -stmt_set - : SET any_name TO DEFAULT SEMI - | RESET (any_name | ALL) SEMI - ; - -cursor_variable - : colid - | PARAM - ; - -exception_sect - : - EXCEPTION proc_exceptions - ; - -proc_exceptions - : proc_exception+ - ; - -proc_exception - : WHEN proc_conditions THEN proc_sect - ; - -proc_conditions - : proc_condition (OR proc_condition)* - ; - -proc_condition - : any_identifier - | SQLSTATE sconst - ; - -//expr_until_semi: - -//; - -//expr_until_rightbracket: - -//; - -//expr_until_loop: - -//; - -block_label_ - : - label_decl - ; - -loop_label_ - : - label_decl - ; - -label_ - : - any_identifier - ; - -exitcond_ - : WHEN expr_until_semi - - ; any_identifier : colid ; - -plsql_unreserved_keyword - : ABSOLUTE_P - | ALIAS - | AND - | ARRAY - | ASSERT - | BACKWARD - | CALL - | CHAIN - | CLOSE - | COLLATE - | COLUMN - //| COLUMN_NAME - | COMMIT - | CONSTANT - | CONSTRAINT - //| CONSTRAINT_NAME - | CONTINUE_P - | CURRENT_P - | CURSOR - //| DATATYPE - | DEBUG - | DEFAULT - //| DETAIL - | DIAGNOSTICS - | DO - | DUMP - | ELSIF - //| ERRCODE - | ERROR - | EXCEPTION - | EXIT - | FETCH - | FIRST_P - | FORWARD - | GET - //| HINT - - //| IMPORT - | INFO - | INSERT - | IS - | LAST_P - //| MESSAGE - - //| MESSAGE_TEXT - | MOVE - | NEXT - | NO - | NOTICE - | OPEN - | OPTION - | PERFORM - //| PG_CONTEXT - - //| PG_DATATYPE_NAME - - //| PG_EXCEPTION_CONTEXT - - //| PG_EXCEPTION_DETAIL - - //| PG_EXCEPTION_HINT - | PRINT_STRICT_PARAMS - | PRIOR - | QUERY - | RAISE - | RELATIVE_P - | RESET - | RETURN - //| RETURNED_SQLSTATE - | ROLLBACK - //| ROW_COUNT - | ROWTYPE - | SCHEMA - //| SCHEMA_NAME - | SCROLL - | SET - | SLICE - | SQLSTATE - | STACKED - | TABLE - //| TABLE_NAME - | TYPE_P - | USE_COLUMN - | USE_VARIABLE - | VARIABLE_CONFLICT - | WARNING - | OUTER_P - ; - -sql_expression - : target_list_? into_clause? from_clause? where_clause? group_clause? having_clause? window_clause? - ; - -expr_until_then - : sql_expression - ; - -expr_until_semi - : sql_expression - ; - -expr_until_rightbracket - : a_expr - ; - -expr_until_loop - : a_expr - ; - -make_execsql_stmt - : stmt returning_clause_into_? - ; - -returning_clause_into_ - : INTO strict_? into_target - - ; \ No newline at end of file diff --git a/sql/postgresql/desc.xml b/sql/postgresql/desc.xml index 64f0ec5f50..07d4cf392e 100644 --- a/sql/postgresql/desc.xml +++ b/sql/postgresql/desc.xml @@ -2,4 +2,5 @@ ^4.10 CSharp;Java + examples/**/*.sql