+
+
+
transaction isolation level
+
+
+ DEFAUL_TRANSACTION_ISOLATION (string)
+
+ Each SQL transaction has an isolation level, which can be
+ either read committed
or
+ serializable
. This parameter controls what the
+ isolation level of each new transaction is set to. The
+ default is read committed.
+
+
+ Consult the PostgreSQL User's Guide and
+ the command SET TRANSACTION for more
+ information.
+
+
+
+
DYNAMIC_LIBRARY_PATH (string)
will use the fsync()> system call in several
places to make sure that updates are physically written to
disk and do not hang around in the kernel buffer cache. This
- increases the chance that a database installation will still
- be usable after an operating system or hardware crash by a
- large amount. (Crashes of the database server itself do
+ increases the chance by a large amount that a database
+ installation will still be usable after an operating system or
+ hardware crash. (Crashes of the database server itself do
not> affect this consideration.)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.50 2001/06/12 22:54:05 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.51 2001/06/30 22:03:25 petere Exp $
*
*-------------------------------------------------------------------------
*/
static bool reset_timezone(void);
static bool parse_timezone(char *);
-static bool show_DefaultXactIsoLevel(void);
-static bool reset_DefaultXactIsoLevel(void);
-static bool parse_DefaultXactIsoLevel(char *);
static bool show_XactIsoLevel(void);
static bool reset_XactIsoLevel(void);
static bool parse_XactIsoLevel(char *);
/* SET TRANSACTION */
-static bool
-parse_DefaultXactIsoLevel(char *value)
-{
-#if 0
- TransactionState s = CurrentTransactionState;
-
-#endif
-
- if (value == NULL)
- {
- reset_DefaultXactIsoLevel();
- return TRUE;
- }
-
-#if 0
- if (s->state != TRANS_DEFAULT)
- {
- elog(ERROR, "ALTER SESSION/SET TRANSACTION ISOLATION LEVEL"
- " can not be called within a transaction");
- return TRUE;
- }
-#endif
-
- if (strcasecmp(value, "SERIALIZABLE") == 0)
- DefaultXactIsoLevel = XACT_SERIALIZABLE;
- else if (strcasecmp(value, "COMMITTED") == 0)
- DefaultXactIsoLevel = XACT_READ_COMMITTED;
- else
- elog(ERROR, "Bad TRANSACTION ISOLATION LEVEL (%s)", value);
-
- return TRUE;
-}
-
-static bool
-show_DefaultXactIsoLevel(void)
-{
-
- if (DefaultXactIsoLevel == XACT_SERIALIZABLE)
- elog(NOTICE, "Default TRANSACTION ISOLATION LEVEL is SERIALIZABLE");
- else
- elog(NOTICE, "Default TRANSACTION ISOLATION LEVEL is READ COMMITTED");
- return TRUE;
-}
-
-static bool
-reset_DefaultXactIsoLevel(void)
-{
-#if 0
- TransactionState s = CurrentTransactionState;
-
- if (s->state != TRANS_DEFAULT)
- {
- elog(ERROR, "ALTER SESSION/SET TRANSACTION ISOLATION LEVEL"
- " can not be called within a transaction");
- return TRUE;
- }
-#endif
-
- DefaultXactIsoLevel = XACT_READ_COMMITTED;
-
- return TRUE;
-}
-
static bool
parse_XactIsoLevel(char *value)
{
if (strcasecmp(value, "SERIALIZABLE") == 0)
XactIsoLevel = XACT_SERIALIZABLE;
- else if (strcasecmp(value, "COMMITTED") == 0)
+ else if (strcasecmp(value, "READ COMMITTED") == 0)
XactIsoLevel = XACT_READ_COMMITTED;
else
elog(ERROR, "Bad TRANSACTION ISOLATION LEVEL (%s)", value);
parse_datestyle(mvalue);
else if (strcasecmp(name, "timezone") == 0)
parse_timezone(mvalue);
- else if (strcasecmp(name, "DefaultXactIsoLevel") == 0)
- parse_DefaultXactIsoLevel(mvalue);
else if (strcasecmp(name, "XactIsoLevel") == 0)
parse_XactIsoLevel(mvalue);
else if (strcasecmp(name, "client_encoding") == 0)
show_datestyle();
else if (strcasecmp(name, "timezone") == 0)
show_timezone();
- else if (strcasecmp(name, "DefaultXactIsoLevel") == 0)
- show_DefaultXactIsoLevel();
else if (strcasecmp(name, "XactIsoLevel") == 0)
show_XactIsoLevel();
else if (strcasecmp(name, "client_encoding") == 0)
ShowAllGUCConfig();
show_datestyle();
show_timezone();
- show_DefaultXactIsoLevel();
show_XactIsoLevel();
show_client_encoding();
show_server_encoding();
reset_datestyle();
else if (strcasecmp(name, "timezone") == 0)
reset_timezone();
- else if (strcasecmp(name, "DefaultXactIsoLevel") == 0)
- reset_DefaultXactIsoLevel();
else if (strcasecmp(name, "XactIsoLevel") == 0)
reset_XactIsoLevel();
else if (strcasecmp(name, "client_encoding") == 0)
reset_random_seed();
else if (strcasecmp(name, "all") == 0)
{
- reset_DefaultXactIsoLevel();
- reset_XactIsoLevel();
reset_random_seed();
/* reset_server_encoding(); */
reset_client_encoding();
reset_timezone();
ResetAllOptions(false);
- } else
+ }
+ else
SetConfigOption(name, NULL,
superuser() ? PGC_SUSET : PGC_USERSET,
false);
* Support for grand unified configuration scheme, including SET
* command, configuration file, and command line options.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.43 2001/06/27 23:31:39 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.44 2001/06/30 22:03:26 petere Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut
.
static bool check_facility(const char *facility);
#endif
+static char *default_iso_level_string;
+
+static bool check_defaultxactisolevel(const char *value);
+static void assign_defaultxactisolevel(const char *value);
+
/*
* Debugging options
*/
static struct config_string
ConfigureNamesString[] =
{
+ {"default_transaction_isolation", PGC_USERSET, &default_iso_level_string,
+ "read committed", check_defaultxactisolevel, assign_defaultxactisolevel},
+
{"dynamic_library_path", PGC_SUSET, &Dynamic_library_path,
"$libdir", NULL, NULL},
}
#endif
+
+
+
+static bool
+check_defaultxactisolevel(const char *value)
+{
+ return (strcasecmp(value, "read committed") == 0
+ || strcasecmp(value, "serializable") == 0)
+ ? true : false;
+}
+
+
+static void
+assign_defaultxactisolevel(const char *value)
+{
+ if (strcasecmp(value, "serializable") == 0)
+ DefaultXactIsoLevel = XACT_SERIALIZABLE;
+ else if (strcasecmp(value, "read committed") == 0)
+ DefaultXactIsoLevel = XACT_READ_COMMITTED;
+ else
+ elog(ERROR, "bogus transaction isolation level");
+}