|
3 | 3 | * procedural language |
4 | 4 | * |
5 | 5 | * 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 $ |
7 | 7 | * |
8 | 8 | * This software is copyrighted by Jan Wieck - Hamburg. |
9 | 9 | * |
@@ -2019,13 +2019,25 @@ exec_stmt_dynexecute(PLpgSQL_execstate * estate, |
2019 | 2019 | caseSPI_OK_SELINTO: |
2020 | 2020 |
|
2021 | 2021 | /* |
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! |
2026 | 2030 | */ |
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"); |
2028 | 2039 | break; |
| 2040 | +} |
2029 | 2041 |
|
2030 | 2042 | default: |
2031 | 2043 | elog(ERROR,"unexpected error %d in EXECUTE of query '%s'", |
|