Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b42e37bc
Commit
b42e37bc
authored
27 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Change quickdie elog notice to a single message.
Clean up FloatExceptionHandler elog message source code.
parent
25e950fc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/tcop/postgres.c
+14
-12
14 additions, 12 deletions
src/backend/tcop/postgres.c
src/backend/tcop/variable.c
+40
-15
40 additions, 15 deletions
src/backend/tcop/variable.c
with
54 additions
and
27 deletions
src/backend/tcop/postgres.c
+
14
−
12
View file @
b42e37bc
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
3
1997/11/
09 04:47:09 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
4
1997/11/
10 15:24:55 thomas
Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -728,8 +728,9 @@ pg_eval_dest(char *query_string,/* string to execute */
...
@@ -728,8 +728,9 @@ pg_eval_dest(char *query_string,/* string to execute */
* handle_warn() is used to catch kill(getpid(),1) which
* handle_warn() is used to catch kill(getpid(),1) which
* occurs when elog(WARN) is called.
* occurs when elog(WARN) is called.
*
*
* quickdie() occurs when signalled by the postmaster, some backend
* quickdie() occurs when signalled by the postmaster.
* has bought the farm we need to stop what we're doing and exit.
* Some backend has bought the farm,
* so we need to stop what we're doing and exit.
*
*
* die() preforms an orderly cleanup via ExitPostgres()
* die() preforms an orderly cleanup via ExitPostgres()
* --------------------------------
* --------------------------------
...
@@ -744,12 +745,12 @@ handle_warn(SIGNAL_ARGS)
...
@@ -744,12 +745,12 @@ handle_warn(SIGNAL_ARGS)
static
void
static
void
quickdie
(
SIGNAL_ARGS
)
quickdie
(
SIGNAL_ARGS
)
{
{
elog
(
NOTICE
,
"Message from PostgreSQL backend:
The Postmaster has "
);
elog
(
NOTICE
,
"Message from PostgreSQL backend:
"
elog
(
NOTICE
,
"
informed me that some other backend
died abnormally and "
);
"
\n\t
The Postmaster has
informed me that some other backend
"
elog
(
NOTICE
,
"
possibly corrupted shared memory.
I have rolled back "
);
" died abnormally and
possibly corrupted shared memory.
"
elog
(
NOTICE
,
"
the current transaction and am
going to terminate your "
);
"
\n\t
I have rolled back
the current transaction and am
"
elog
(
NOTICE
,
"
database system connection and exit.
Please reconnect to"
);
" going to terminate your
database system connection and exit.
"
elog
(
NOTICE
,
"
the database system and repeat your query."
);
"
\n\t
Please reconnect to
the database system and repeat your query."
);
/*
/*
...
@@ -771,8 +772,9 @@ die(SIGNAL_ARGS)
...
@@ -771,8 +772,9 @@ die(SIGNAL_ARGS)
static
void
static
void
FloatExceptionHandler
(
SIGNAL_ARGS
)
FloatExceptionHandler
(
SIGNAL_ARGS
)
{
{
elog
(
WARN
,
"floating point exception! the last floating point operation eit\
elog
(
WARN
,
"floating point exception!"
her exceeded legal ranges or was a divide by zero"
);
" The last floating point operation either exceeded legal ranges"
" or was a divide by zero"
);
}
}
...
@@ -1339,7 +1341,7 @@ PostgresMain(int argc, char *argv[])
...
@@ -1339,7 +1341,7 @@ PostgresMain(int argc, char *argv[])
if
(
IsUnderPostmaster
==
false
)
if
(
IsUnderPostmaster
==
false
)
{
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.5
3
$ $Date: 1997/11/
09 04:47:09
$"
);
puts
(
"$Revision: 1.5
4
$ $Date: 1997/11/
10 15:24:55
$"
);
}
}
/* ----------------
/* ----------------
...
...
This diff is collapsed.
Click to expand it.
src/backend/tcop/variable.c
+
40
−
15
View file @
b42e37bc
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
* 'SHOW var' and 'RESET var' statements.
*
*
* $Id: variable.c,v 1.
19
1997/11/
07 06:43:1
6 thomas Exp $
* $Id: variable.c,v 1.
20
1997/11/
10 15:24:5
6 thomas Exp $
*
*
*/
*/
...
@@ -431,8 +431,13 @@ reset_date()
...
@@ -431,8 +431,13 @@ reset_date()
return
TRUE
;
return
TRUE
;
}
}
/* Timezone support
* Working storage for strings is allocated with an arbitrary size of 64 bytes.
*/
static
char
*
defaultTZ
=
NULL
;
static
char
*
defaultTZ
=
NULL
;
static
char
TZvalue
[
10
];
static
char
TZvalue
[
64
];
static
char
tzbuf
[
64
];
bool
bool
parse_timezone
(
const
char
*
value
)
parse_timezone
(
const
char
*
value
)
...
@@ -447,20 +452,30 @@ parse_timezone(const char *value)
...
@@ -447,20 +452,30 @@ parse_timezone(const char *value)
while
((
value
=
get_token
(
&
tok
,
NULL
,
value
))
!=
0
)
while
((
value
=
get_token
(
&
tok
,
NULL
,
value
))
!=
0
)
{
{
if
((
defaultTZ
==
NULL
)
&&
(
getenv
(
"TZ"
)
!=
NULL
))
/* Not yet tried to save original value from environment? */
if
(
defaultTZ
==
NULL
)
{
/* found something? then save it for later */
if
(
getenv
(
"TZ"
)
!=
NULL
)
{
{
defaultTZ
=
getenv
(
"TZ"
);
defaultTZ
=
getenv
(
"TZ"
);
if
(
defaultTZ
==
NULL
)
if
(
defaultTZ
==
NULL
)
{
defaultTZ
=
(
char
*
)
-
1
;
defaultTZ
=
(
char
*
)
-
1
;
else
strcpy
(
TZvalue
,
defaultTZ
);
}
}
/* found nothing so mark with an invalid pointer */
else
else
{
{
strcpy
(
TZvalue
,
defaultTZ
)
;
defaultTZ
=
(
char
*
)
-
1
;
}
}
}
}
setenv
(
"TZ"
,
tok
,
TRUE
);
strcpy
(
tzbuf
,
"TZ="
);
strcat
(
tzbuf
,
tok
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
WARN
,
"Unable to set TZ environment variable to %s"
,
tok
);
tzset
();
tzset
();
PFREE
(
tok
);
PFREE
(
tok
);
}
}
...
@@ -471,29 +486,39 @@ parse_timezone(const char *value)
...
@@ -471,29 +486,39 @@ parse_timezone(const char *value)
bool
bool
show_timezone
()
show_timezone
()
{
{
char
buf
[
64
];
char
*
tz
;
char
*
tz
;
tz
=
getenv
(
"TZ"
);
tz
=
getenv
(
"TZ"
);
strcpy
(
buf
,
"Time zone is "
);
elog
(
NOTICE
,
"Time zone is %s"
,
((
tz
!=
NULL
)
?
tz
:
"unknown"
));
strcat
(
buf
,
((
tz
!=
NULL
)
?
tz
:
"unknown"
));
elog
(
NOTICE
,
buf
,
NULL
);
return
TRUE
;
return
TRUE
;
}
/* show_timezone() */
}
/* show_timezone() */
/* reset_timezone()
* Set TZ environment variable to original value.
* Note that if TZ was originally not set, TZ should be cleared.
* unsetenv() works fine, but is BSD, not POSIX, and is not available
* under Solaris, among others. Apparently putenv() called as below
* clears the process-specific environment variables.
* Other reasonable arguments to putenv() (e.g. "TZ=", "TZ", "") result
* in a core dump (under Linux anyway).
*/
bool
bool
reset_timezone
()
reset_timezone
()
{
{
if
((
defaultTZ
!=
NULL
)
&&
(
defaultTZ
!=
(
char
*
)
-
1
))
if
((
defaultTZ
!=
NULL
)
&&
(
defaultTZ
!=
(
char
*
)
-
1
))
{
{
setenv
(
"TZ"
,
TZvalue
,
TRUE
);
strcpy
(
tzbuf
,
"TZ="
);
strcat
(
tzbuf
,
TZvalue
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
WARN
,
"Unable to set TZ environment variable to %s"
,
TZvalue
);
}
}
else
else
{
{
unsetenv
(
"TZ"
);
strcpy
(
tzbuf
,
"="
);
if
(
putenv
(
tzbuf
)
!=
0
)
elog
(
WARN
,
"Unable to clear TZ environment variable"
,
NULL
);
}
}
tzset
();
tzset
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment