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

Commitd55588e

Browse files
committed
Guard against transaction control statements in SQL functions. This
never worked, but it particularly doesn't work now.
1 parent23645f0 commitd55588e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/backend/executor/functions.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.86 2004/08/29 05:06:42 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.87 2004/09/06 18:10:38 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -285,6 +285,11 @@ postquel_getnext(execution_state *es)
285285

286286
if (es->qd->operation==CMD_UTILITY)
287287
{
288+
/* Can't handle starting or committing a transaction */
289+
if (IsA(es->qd->parsetree->utilityStmt,TransactionStmt))
290+
ereport(ERROR,
291+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
292+
errmsg("cannot begin/end transactions in SQL functions")));
288293
ProcessUtility(es->qd->parsetree->utilityStmt,es->qd->params,
289294
es->qd->dest,NULL);
290295
returnNULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp