diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-24 19:43:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-24 19:43:03 +0000 |
commit | b120485f9cf55e96e8b945df12303c9ea8ef94b7 (patch) | |
tree | 9e8d6bd4c47322bd647086e4f9c5b36470b995bc /src/backend/commands/variable.c | |
parent | 12a2121c75ee2078bb23f4dfecb87bcf674017f2 (diff) | |
download | postgresql-b120485f9cf55e96e8b945df12303c9ea8ef94b7.tar.gz postgresql-b120485f9cf55e96e8b945df12303c9ea8ef94b7.zip |
GUC assign hooks that look at external state in deciding whether a
setting is valid must ignore that state and permit the assignment anyway
when source is PGC_S_OVERRIDE. Otherwise they may disallow a rollback
at transaction abort, which is The Wrong Thing. Per example from
Michael Fuhr 12-Sep-04.
Diffstat (limited to 'src/backend/commands/variable.c')
-rw-r--r-- | src/backend/commands/variable.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index e0ccd668e59..26816463b57 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.103 2004/08/31 19:28:51 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.104 2004/09/24 19:42:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -481,7 +481,8 @@ assign_XactIsoLevel(const char *value, bool doit, GucSource source) ereport(ERROR, (errcode(ERRCODE_ACTIVE_SQL_TRANSACTION), errmsg("SET TRANSACTION ISOLATION LEVEL must be called before any query"))); - else + /* source == PGC_S_OVERRIDE means do it anyway, eg at xact abort */ + else if (source != PGC_S_OVERRIDE) return NULL; } if (IsSubTransaction()) @@ -490,7 +491,8 @@ assign_XactIsoLevel(const char *value, bool doit, GucSource source) ereport(ERROR, (errcode(ERRCODE_ACTIVE_SQL_TRANSACTION), errmsg("SET TRANSACTION ISOLATION LEVEL must not be called in a subtransaction"))); - else + /* source == PGC_S_OVERRIDE means do it anyway, eg at xact abort */ + else if (source != PGC_S_OVERRIDE) return NULL; } |