1010 *
1111 *
1212 * IDENTIFICATION
13- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.78 1999/05/19 17:53:10 momjian Exp $
13+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.79 1999/05/20 12:12:55 wieck Exp $
1414 *
1515 * HISTORY
1616 * AUTHORDATEMAJOR EVENT
@@ -196,7 +196,7 @@ Oidparam_type(int t); /* used in parse_expr.c */
196196
197197%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy,
198198index_opt_unique, opt_verbose, opt_analyze
199- %type <boolean>cursor_clause, opt_cursor, opt_readonly, opt_of
199+ %type <boolean> opt_cursor
200200
201201%type <ival>copy_dirn, def_type, opt_direction, remove_type,
202202opt_column, event
@@ -2646,7 +2646,7 @@ UpdateStmt: UPDATE relation_name
26462646 *
26472647 *****************************************************************************/
26482648/***S*I***/
2649- CursorStmt: DECLARE name opt_cursor CURSOR FOR SelectStmt cursor_clause
2649+ CursorStmt: DECLARE name opt_cursor CURSOR FOR SelectStmt
26502650 {
26512651 SelectStmt *n;
26522652
@@ -2664,6 +2664,9 @@ CursorStmt: DECLARE name opt_cursor CURSOR FOR SelectStmt cursor_clause
26642664
26652665n->portalname = $2;
26662666n->binary = $3;
2667+ if (n->forUpdate != NULL)
2668+ elog(ERROR,"DECLARE/UPDATE not supported;"
2669+ " Cursors must be READ ONLY.");
26672670$$ = (Node *)n;
26682671}
26692672;
@@ -2675,24 +2678,6 @@ opt_cursor: BINARY{ $$ = TRUE; }
26752678| /*EMPTY*/{ $$ = FALSE; }
26762679;
26772680
2678- cursor_clause: FOR opt_readonly{ $$ = $2; }
2679- | /*EMPTY*/{ $$ = FALSE; }
2680- ;
2681-
2682- opt_readonly: READ ONLY{ $$ = TRUE; }
2683- | UPDATE opt_of
2684- {
2685- elog(ERROR,"DECLARE/UPDATE not supported;"
2686- " Cursors must be READ ONLY.");
2687- $$ = FALSE;
2688- }
2689- ;
2690-
2691- opt_of: OF columnList
2692- {
2693- $$ = FALSE;
2694- }
2695-
26962681/*****************************************************************************
26972682 *
26982683 *QUERY:
@@ -3007,6 +2992,7 @@ having_clause: HAVING a_expr
30072992;
30082993
30092994for_update_clause: FOR UPDATE update_list{ $$ = $3; }
2995+ | FOR READ ONLY{ $$ = NULL; }
30102996| /* EMPTY */{ $$ = NULL; }
30112997;
30122998