summaryrefslogtreecommitdiff
path: root/src/backend/utils/error/elog.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2001-06-20 18:07:56 +0000
committerPeter Eisentraut <peter_e@gmx.net>2001-06-20 18:07:56 +0000
commit9b4bfbdc2cd74342d9febb74c93acad1d4de84ca (patch)
tree0239cbb8e885f8420b5ec967c928f4e6fdc5bed1 /src/backend/utils/error/elog.c
parent588463a449e70aff33d799b5c9475ab94fbdf4c9 (diff)
Handle reading of startup packet and authentication exchange after forking
a new postmaster child process. This should eliminate problems with authentication blocking (e.g., ident, SSL init) and also reduce problems with the accept queue filling up under heavy load. The option to send elog output to a different file per backend (postgres -o) has been disabled for now because the initialization would have to happen in a different order and it's not clear we want to keep this anyway.
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r--src/backend/utils/error/elog.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index e2ffb7bc825..2a41d3b57fd 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.86 2001/06/08 21:16:48 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.87 2001/06/20 18:07:56 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -129,10 +129,6 @@ elog(int lev, const char *fmt,...)
/* size of the prefix needed for timestamp and pid, if enabled */
size_t timestamp_size;
- /* ignore debug msgs if noplace to send */
- if (lev == DEBUG && Debugfile < 0)
- return;
-
/* Save error str before calling any function that might change errno */
errorstr = useful_strerror(errno);
@@ -336,10 +332,9 @@ elog(int lev, const char *fmt,...)
/* syslog doesn't want a trailing newline, but other destinations do */
strcat(msg_buf, "\n");
- /* Write to debug file, if open and enabled */
- /* NOTE: debug file is typically pointed at stderr */
- if (Debugfile >= 0 && Use_syslog <= 1)
- write(Debugfile, msg_buf, strlen(msg_buf));
+ /* write to terminal */
+ if (Use_syslog <= 1 || whereToSendOutput == Debug)
+ write(2, msg_buf, strlen(msg_buf));
if (lev > DEBUG && whereToSendOutput == Remote)
{
@@ -371,17 +366,6 @@ elog(int lev, const char *fmt,...)
MemoryContextSwitchTo(oldcxt);
}
- if (lev > DEBUG && whereToSendOutput != Remote)
- {
- /*
- * We are running as an interactive backend, so just send the
- * message to stderr. But don't send a duplicate if Debugfile
- * write, above, already sent to stderr.
- */
- if (Debugfile != fileno(stderr))
- fputs(msg_buf, stderr);
- }
-
/* done with the message, release space */
if (fmt_buf != fmt_fixedbuf)
free(fmt_buf);