Tweak new error messages to match the actual syntax of DECLARE CURSOR.

(Last night I copied-and-pasted from the WITH HOLD case, but that's
wrong because of the bizarrely irregular syntax specified by the standard.)
This commit is contained in:
Tom Lane 2007-10-25 13:48:57 +00:00
parent 0e3ddc8dd5
commit fcc20bd4ba
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.182 2007/10/24 23:27:08 tgl Exp $ * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.183 2007/10/25 13:48:57 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -994,7 +994,7 @@ SPI_cursor_open(const char *name, SPIPlanPtr plan,
((PlannedStmt *) linitial(stmt_list))->rowMarks != NIL) ((PlannedStmt *) linitial(stmt_list))->rowMarks != NIL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("DECLARE CURSOR SCROLL ... FOR UPDATE/SHARE is not supported"), errmsg("DECLARE SCROLL CURSOR ... FOR UPDATE/SHARE is not supported"),
errdetail("Scrollable cursors must be READ ONLY."))); errdetail("Scrollable cursors must be READ ONLY.")));
} }

View File

@ -17,7 +17,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.368 2007/10/24 23:27:08 tgl Exp $ * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.369 2007/10/25 13:48:57 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1627,14 +1627,14 @@ transformDeclareCursorStmt(ParseState *pstate, DeclareCursorStmt *stmt)
if (result->rowMarks != NIL && (stmt->options & CURSOR_OPT_SCROLL)) if (result->rowMarks != NIL && (stmt->options & CURSOR_OPT_SCROLL))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("DECLARE CURSOR SCROLL ... FOR UPDATE/SHARE is not supported"), errmsg("DECLARE SCROLL CURSOR ... FOR UPDATE/SHARE is not supported"),
errdetail("Scrollable cursors must be READ ONLY."))); errdetail("Scrollable cursors must be READ ONLY.")));
/* FOR UPDATE and INSENSITIVE are not compatible */ /* FOR UPDATE and INSENSITIVE are not compatible */
if (result->rowMarks != NIL && (stmt->options & CURSOR_OPT_INSENSITIVE)) if (result->rowMarks != NIL && (stmt->options & CURSOR_OPT_INSENSITIVE))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("DECLARE CURSOR INSENSITIVE ... FOR UPDATE/SHARE is not supported"), errmsg("DECLARE INSENSITIVE CURSOR ... FOR UPDATE/SHARE is not supported"),
errdetail("Insensitive cursors must be READ ONLY."))); errdetail("Insensitive cursors must be READ ONLY.")));
/* We won't need the raw querytree any more */ /* We won't need the raw querytree any more */