-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.312 2005/11/27 01:22:23 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.313 2005/12/02 15:03:57 meskes Exp $ */
/* Copyright comment */
%{
/* special embedded SQL token */
%token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK
- SQL_CALL SQL_CARDINALITY SQL_CONNECT SQL_CONNECTION
+ SQL_CALL SQL_CARDINALITY SQL_CONNECT
SQL_CONTINUE SQL_COUNT SQL_CURRENT SQL_DATA
SQL_DATETIME_INTERVAL_CODE
SQL_DATETIME_INTERVAL_PRECISION SQL_DESCRIBE
%type <str> opt_instead event RuleActionList opt_using CreateAssertStmt
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
%type <str> RuleStmt opt_column oper_argtypes NumConst var_name
-%type <str> MathOp RemoveFuncStmt aggr_argtype
+%type <str> MathOp RemoveFuncStmt aggr_argtype ECPGunreserved_con
%type <str> RemoveAggrStmt opt_procedural select_no_parens CreateCastStmt
%type <str> RemoveOperStmt RenameStmt all_Op opt_trusted opt_lancompiler
%type <str> VariableSetStmt var_value zone_value VariableShowStmt
%type <str> CreateGroupStmt AlterGroupStmt DropGroupStmt key_delete
%type <str> opt_force key_update CreateSchemaStmt PosIntStringConst
%type <str> IntConst PosIntConst grantee_list func_type opt_or_replace
-%type <str> select_limit CheckPointStmt
+%type <str> select_limit CheckPointStmt ECPGColId
%type <str> OptSchemaName OptSchemaEltList schema_stmt opt_drop_behavior
%type <str> handler_name any_name_list any_name opt_as insert_column_list
%type <str> columnref function_name insert_target_el AllConstVar
{ $$ = make_str("session authorization default"); }
;
-var_name: ColId { $$ = $1; }
+var_name: ECPGColId { $$ = $1; }
| var_name '.' ColId { $$ = cat_str(3, $1, make_str("."), $3); }
;
* set the actual connection, this needs a differnet handling as the other
* set commands
*/
-ECPGSetConnection: SET SQL_CONNECTION TO connection_object { $$ = $4; }
- | SET SQL_CONNECTION '=' connection_object { $$ = $4; }
- | SET SQL_CONNECTION connection_object { $$ = $3; }
+ECPGSetConnection: SET CONNECTION TO connection_object { $$ = $4; }
+ | SET CONNECTION '=' connection_object { $$ = $4; }
+ | SET CONNECTION connection_object { $$ = $3; }
;
/*
* is chosen in part to make keywords acceptable as names wherever possible.
*/
+ECPGColId:ident { $$ = $1; }
+ | ECPGunreserved_interval { $$ = $1; }
+ | ECPGunreserved_con { $$ = $1; }
+ | col_name_keyword { $$ = $1; }
+ | ECPGKeywords { $$ = $1; }
+ | ECPGCKeywords { $$ = $1; }
+ | CHAR_P { $$ = make_str("char"); }
+ ;
/* Column identifier --- names that can be column, table, etc names.
*/
ColId: ident { $$ = $1; }
*/
unreserved_keyword: ECPGunreserved_interval | ECPGunreserved;
-ECPGunreserved_interval: DAY_P { $$ = make_str("day"); }
+ECPGunreserved_interval: DAY_P { $$ = make_str("day"); }
| HOUR_P { $$ = make_str("hour"); }
| MINUTE_P { $$ = make_str("minute"); }
| MONTH_P { $$ = make_str("month"); }
| YEAR_P { $$ = make_str("year"); }
;
-ECPGunreserved: ABORT_P { $$ = make_str("abort"); }
+/* The following symbol must be excluded from var_name but still included in ColId
+ to enable ecpg special postgresql variables with this name:
+ CONNECTION
+ */
+ECPGunreserved: ECPGunreserved_con { $$ = $1; }
+ | CONNECTION { $$ = make_str("connection"); }
+ ;
+
+ECPGunreserved_con: ABORT_P { $$ = make_str("abort"); }
| ABSOLUTE_P { $$ = make_str("absolute"); }
| ACCESS { $$ = make_str("access"); }
| ACTION { $$ = make_str("action"); }
| COMMENT { $$ = make_str("comment"); }
| COMMIT { $$ = make_str("commit"); }
| COMMITTED { $$ = make_str("committed"); }
- | CONNECTION { $$ = make_str("connection"); }
+/* | CONNECTION { $$ = make_str("connection"); }*/
| CONSTRAINTS { $$ = make_str("constraints"); }
| CONVERSION_P { $$ = make_str("conversion"); }
| COPY { $$ = make_str("copy"); }