diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-10-09 21:21:57 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-10-09 21:26:00 +0200 |
commit | f8c10f616fa5081999ac48a0b6621057db806851 (patch) | |
tree | 043fb6016948bca317dea48bdc43bde2456a6628 /src/backend/utils/misc/guc.c | |
parent | b6b297d20df9f738be20a450f80bade535819220 (diff) |
Turn transaction_isolation into GUC enum
It was previously a string setting that was converted into an enum by
custom code, but using the GUC enum facility seems much simpler and
doesn't change any functionality, except that
set transaction_isolation='default';
no longer works, but that was never documented and doesn't work with
any other transaction characteristics. (Note that this is not the
same as RESET or SET TO DEFAULT, which still work.)
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://www.postgresql.org/message-id/457db615-e84c-4838-310e-43841eb806e5@iki.fi
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 0bec3914f80..2317e8be6be 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -515,7 +515,6 @@ static int server_version_num; static char *timezone_string; static char *log_timezone_string; static char *timezone_abbreviations_string; -static char *XactIsoLevel_string; static char *data_directory; static char *session_authorization_string; static int max_function_args; @@ -3619,17 +3618,6 @@ static struct config_string ConfigureNamesString[] = }, { - {"transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, - gettext_noop("Sets the current transaction's isolation level."), - NULL, - GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE - }, - &XactIsoLevel_string, - "default", - check_XactIsoLevel, assign_XactIsoLevel, show_XactIsoLevel - }, - - { {"unix_socket_group", PGC_POSTMASTER, CONN_AUTH_SETTINGS, gettext_noop("Sets the owning group of the Unix-domain socket."), gettext_noop("The owning user of the socket is always the user " @@ -3969,6 +3957,17 @@ static struct config_enum ConfigureNamesEnum[] = }, { + {"transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, + gettext_noop("Sets the current transaction's isolation level."), + NULL, + GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE + }, + &XactIsoLevel, + XACT_READ_COMMITTED, isolation_level_options, + check_XactIsoLevel, NULL, NULL + }, + + { {"IntervalStyle", PGC_USERSET, CLIENT_CONN_LOCALE, gettext_noop("Sets the display format for interval values."), NULL, @@ -4776,7 +4775,7 @@ InitializeGUCOptions(void) * Prevent any attempt to override the transaction modes from * non-interactive sources. */ - SetConfigOption("transaction_isolation", "default", + SetConfigOption("transaction_isolation", "read committed", PGC_POSTMASTER, PGC_S_OVERRIDE); SetConfigOption("transaction_read_only", "no", PGC_POSTMASTER, PGC_S_OVERRIDE); |