Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb77ad5

Browse files
committed
Re-allow CREATE AS (but not SELECT INTO) in EXECUTE.
1 parent0441ce5 commiteb77ad5

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 18 additions & 6 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.54 2002/03/06 06:10:46 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.55 2002/03/25 07:41:10 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -2019,13 +2019,25 @@ exec_stmt_dynexecute(PLpgSQL_execstate * estate,
20192019
caseSPI_OK_SELINTO:
20202020

20212021
/*
2022-
* Disallow this for now, because its behavior is not
2023-
* consistent with SELECT INTO in a normal plpgsql context. We
2024-
* need to reimplement EXECUTE to parse the string as a
2025-
* plpgsql command, not just feed it to SPI_exec.
2022+
* We want to disallow SELECT INTO for now, because its behavior
2023+
* is not consistent with SELECT INTO in a normal plpgsql
2024+
* context. (We need to reimplement EXECUTE to parse the string
2025+
* as a plpgsql command, not just feed it to SPI_exec.)
2026+
* However, CREATE AS should be allowed ... and since it produces
2027+
* the same parsetree as SELECT INTO, there's no way to tell
2028+
* the difference except to look at the source text. Wotta
2029+
* kluge!
20262030
*/
2027-
elog(ERROR,"EXECUTE of SELECT ... INTO is not implemented yet");
2031+
{
2032+
char*ptr;
2033+
2034+
for (ptr=querystr;*ptr;ptr++)
2035+
if (!isspace((unsignedchar)*ptr))
2036+
break;
2037+
if (*ptr=='S'||*ptr=='s')
2038+
elog(ERROR,"EXECUTE of SELECT ... INTO is not implemented yet");
20282039
break;
2040+
}
20292041

20302042
default:
20312043
elog(ERROR,"unexpected error %d in EXECUTE of query '%s'",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp