From 5eae9ddbbd881f08111dd25de03eb1c3adbfdea6 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 | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/backend/commands/variable.c') diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 7b04226017..1f16ae962e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -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