Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1c2d2db

Browse files
committed
Give a more intelligible and useful error message for SELECT with no
destination in plpgsql.
1 parent 330b112 commit 1c2d2db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pl/plpgsql/src/pl_exec.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.50 2001/11/08 20:37:52 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.51 2001/11/13 02:05:27 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -2045,7 +2045,8 @@ exec_stmt_execsql(PLpgSQL_execstate * estate,
20452045
break;
20462046

20472047
case SPI_OK_SELECT:
2048-
elog(ERROR, "unexpected SELECT query in exec_stmt_execsql()");
2048+
elog(ERROR, "SELECT query has no destination for result data."
2049+
"\n\tIf you want to discard the results, use PERFORM instead.");
20492050

20502051
default:
20512052
elog(ERROR, "error executing query \"%s\"",

0 commit comments

Comments
 (0)