|
11 | 11 | * |
12 | 12 | * |
13 | 13 | * IDENTIFICATION |
14 | | - * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.522 2006/01/21 02:16:19 momjian Exp $ |
| 14 | + * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.523 2006/01/22 05:20:33 neilc Exp $ |
15 | 15 | * |
16 | 16 | * HISTORY |
17 | 17 | * AUTHOR DATE MAJOR EVENT |
@@ -291,6 +291,7 @@ static void doNegateFloat(Value *v); |
291 | 291 | %type <node> table_ref |
292 | 292 | %type <jexpr> joined_table |
293 | 293 | %type <range> relation_expr |
| 294 | +%type <range> relation_expr_opt_alias |
294 | 295 | %type <target> target_el insert_target_el update_target_el insert_column_item |
295 | 296 |
|
296 | 297 | %type <typnam> Typename SimpleTypename ConstTypename |
@@ -5148,7 +5149,8 @@ insert_column_item: |
5148 | 5149 | * |
5149 | 5150 | *****************************************************************************/ |
5150 | 5151 |
|
5151 | | -DeleteStmt: DELETE_P FROM relation_expr using_clause where_clause |
| 5152 | +DeleteStmt: DELETE_P FROM relation_expr_opt_alias |
| 5153 | + using_clause where_clause |
5152 | 5154 | { |
5153 | 5155 | DeleteStmt *n = makeNode(DeleteStmt); |
5154 | 5156 | n->relation = $3; |
@@ -5200,7 +5202,7 @@ opt_nowait: NOWAIT { $$ = TRUE; } |
5200 | 5202 | * |
5201 | 5203 | *****************************************************************************/ |
5202 | 5204 |
|
5203 | | -UpdateStmt: UPDATE relation_expr |
| 5205 | +UpdateStmt: UPDATE relation_expr_opt_alias |
5204 | 5206 | SET update_target_list |
5205 | 5207 | from_clause |
5206 | 5208 | where_clause |
@@ -5878,6 +5880,20 @@ relation_expr: |
5878 | 5880 | ; |
5879 | 5881 |
|
5880 | 5882 |
|
| 5883 | +relation_expr_opt_alias: relation_expr |
| 5884 | + { |
| 5885 | + $$ = $1; |
| 5886 | + } |
| 5887 | + | relation_expr opt_as IDENT |
| 5888 | + { |
| 5889 | + Alias *alias = makeNode(Alias); |
| 5890 | + alias->aliasname = $3; |
| 5891 | + $1->alias = alias; |
| 5892 | + $$ = $1; |
| 5893 | + } |
| 5894 | + ; |
| 5895 | + |
| 5896 | + |
5881 | 5897 | func_table: func_expr { $$ = $1; } |
5882 | 5898 | ; |
5883 | 5899 |
|
|
0 commit comments