From 96889392e915e5c77384d274db2a2c42b684c274 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 6 Nov 2003 22:08:15 +0000 Subject: Implement isolation levels read uncommitted and repeatable read as acting like the next higher one. --- src/backend/commands/variable.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/backend/commands/variable.c') diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 7c862a5b3ac..f763163957e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -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"; + } } -- cgit v1.2.3