1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Implement isolation levels read uncommitted and repeatable read as acting

like the next higher one.
This commit is contained in:
Peter Eisentraut
2003-11-06 22:08:15 +00:00
parent 144a2ecd57
commit 96889392e9
15 changed files with 156 additions and 69 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.159 2003/10/02 06:34:03 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.160 2003/11/06 22:08:14 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1576,7 +1576,7 @@ ltrmark:;
case HeapTupleUpdated:
ReleaseBuffer(buffer);
if (XactIsoLevel == XACT_SERIALIZABLE)
if (IsXactIsoLevelSerializable)
ereport(ERROR,
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("could not serialize access due to concurrent update")));

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.88 2003/09/25 06:57:59 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.89 2003/11/06 22:08:14 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -640,11 +640,21 @@ assign_XactIsoLevel(const char *value, bool doit, bool interactive)
if (doit)
XactIsoLevel = XACT_SERIALIZABLE;
}
else if (strcmp(value, "repeatable read") == 0)
{
if (doit)
XactIsoLevel = XACT_REPEATABLE_READ;
}
else if (strcmp(value, "read committed") == 0)
{
if (doit)
XactIsoLevel = XACT_READ_COMMITTED;
}
else if (strcmp(value, "read uncommitted") == 0)
{
if (doit)
XactIsoLevel = XACT_READ_UNCOMMITTED;
}
else if (strcmp(value, "default") == 0)
{
if (doit)
@@ -659,10 +669,19 @@ assign_XactIsoLevel(const char *value, bool doit, bool interactive)
const char *
show_XactIsoLevel(void)
{
if (XactIsoLevel == XACT_SERIALIZABLE)
return "serializable";
else
return "read committed";
switch (XactIsoLevel)
{
case XACT_READ_UNCOMMITTED:
return "read uncommitted";
case XACT_READ_COMMITTED:
return "read committed";
case XACT_REPEATABLE_READ:
return "repeatable read";
case XACT_SERIALIZABLE:
return "serializable";
default:
return "bogus";
}
}