From 573a71a5da70d6e2503c8f53e3b4f26b3b6d738d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 1 Jul 2004 00:52:04 +0000 Subject: Nested transactions. There is still much left to do, especially on the performance front, but with feature freeze upon us I think it's time to drive a stake in the ground and say that this will be in 7.5. Alvaro Herrera, with some help from Tom Lane. --- src/backend/commands/variable.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/variable.c') diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 4a58419079a..dfa3f7121ed 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.97 2004/05/26 04:41:13 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.98 2004/07/01 00:50:12 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -470,10 +470,17 @@ show_timezone(void) const char * assign_XactIsoLevel(const char *value, bool doit, GucSource source) { - if (doit && source >= PGC_S_INTERACTIVE && SerializableSnapshot != NULL) + if (doit && source >= PGC_S_INTERACTIVE) + { + if (SerializableSnapshot != NULL) ereport(ERROR, (errcode(ERRCODE_ACTIVE_SQL_TRANSACTION), errmsg("SET TRANSACTION ISOLATION LEVEL must be called before any query"))); + if (IsSubTransaction()) + ereport(ERROR, + (errcode(ERRCODE_ACTIVE_SQL_TRANSACTION), + errmsg("SET TRANSACTION ISOLATION LEVEL must not be called in a subtransaction"))); + } if (strcmp(value, "serializable") == 0) { -- cgit v1.2.3