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

Commit 8a2cdd7

Browse files
committed
EXECUTE of a SELECT ... INTO now draws a 'not implemented' error,
rather than executing the INTO clause with non-plpgsql semantics as it was doing for the last few weeks/months. This keeps our options open for making it do the right plpgsql-ish thing in future without creating a backwards compatibility problem. There is no loss of functionality since people can get the same behavior with CREATE TABLE AS.
1 parent bbac19a commit 8a2cdd7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/pl/plpgsql/src/pl_exec.c

Lines changed: 11 additions & 2 deletions
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.36 2001/01/22 00:50:07 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.37 2001/02/09 00:14:26 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -1993,7 +1993,6 @@ exec_stmt_dynexecute(PLpgSQL_execstate * estate,
19931993
switch (exec_res)
19941994
{
19951995
case SPI_OK_SELECT:
1996-
case SPI_OK_SELINTO:
19971996
case SPI_OK_INSERT:
19981997
case SPI_OK_UPDATE:
19991998
case SPI_OK_DELETE:
@@ -2006,6 +2005,16 @@ exec_stmt_dynexecute(PLpgSQL_execstate * estate,
20062005
*/
20072006
break;
20082007

2008+
case SPI_OK_SELINTO:
2009+
/*
2010+
* Disallow this for now, because its behavior is not consistent
2011+
* with SELECT INTO in a normal plpgsql context. We need to
2012+
* reimplement EXECUTE to parse the string as a plpgsql command,
2013+
* not just feed it to SPI_exec.
2014+
*/
2015+
elog(ERROR, "EXECUTE of SELECT ... INTO is not implemented yet");
2016+
break;
2017+
20092018
default:
20102019
elog(ERROR, "unexpected error %d in EXECUTE of query '%s'",
20112020
exec_res, querystr);

0 commit comments

Comments
 (0)