Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
1e901bbe
Commit
1e901bbe
authored
Jul 14, 2000
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel.
parent
2016898b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
2 deletions
+73
-2
src/backend/commands/variable.c
src/backend/commands/variable.c
+73
-2
No files found.
src/backend/commands/variable.c
View file @
1e901bbe
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.3
8 2000/06/22 22:31:17 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.3
9 2000/07/14 15:35:44 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -43,6 +43,9 @@ static bool show_timezone(void);
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
*
);
...
...
@@ -434,6 +437,68 @@ reset_timezone()
/* 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
()
{
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
()
{
#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
)
{
...
...
@@ -535,6 +600,8 @@ SetPGVariable(const char *name, const char *value)
parse_date
(
pstrdup
(
value
));
else
if
(
strcasecmp
(
name
,
"timezone"
)
==
0
)
parse_timezone
(
pstrdup
(
value
));
else
if
(
strcasecmp
(
name
,
"DefaultXactIsoLevel"
)
==
0
)
parse_DefaultXactIsoLevel
(
pstrdup
(
value
));
else
if
(
strcasecmp
(
name
,
"XactIsoLevel"
)
==
0
)
parse_XactIsoLevel
(
pstrdup
(
value
));
#ifdef MULTIBYTE
...
...
@@ -557,6 +624,8 @@ GetPGVariable(const char *name)
show_date
();
else
if
(
strcasecmp
(
name
,
"timezone"
)
==
0
)
show_timezone
();
else
if
(
strcasecmp
(
name
,
"DefaultXactIsoLevel"
)
==
0
)
show_DefaultXactIsoLevel
();
else
if
(
strcasecmp
(
name
,
"XactIsoLevel"
)
==
0
)
show_XactIsoLevel
();
#ifdef MULTIBYTE
...
...
@@ -581,8 +650,10 @@ ResetPGVariable(const char *name)
reset_date
();
else
if
(
strcasecmp
(
name
,
"timezone"
)
==
0
)
reset_timezone
();
else
if
(
strcasecmp
(
name
,
"DefaultXactIsoLevel"
)
==
0
)
reset_DefaultXactIsoLevel
();
else
if
(
strcasecmp
(
name
,
"XactIsoLevel"
)
==
0
)
reset_XactIsoLevel
();
reset_XactIsoLevel
();
#ifdef MULTIBYTE
else
if
(
strcasecmp
(
name
,
"client_encoding"
)
==
0
)
reset_client_encoding
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment