diff options
author | Marc G. Fournier <scrappy@hub.org> | 1997-11-09 04:43:35 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1997-11-09 04:43:35 +0000 |
commit | 213d7b1ae3dc05a2df06f01d2dca0b58fa2747e9 (patch) | |
tree | a8c0c5cc00f984880516bd802f0ec49ed8ce766e /src | |
parent | 8d0fe2d0d47afd00bf5a184d16d04246727f747a (diff) | |
download | postgresql-213d7b1ae3dc05a2df06f01d2dca0b58fa2747e9.tar.gz postgresql-213d7b1ae3dc05a2df06f01d2dca0b58fa2747e9.zip |
From: Bryan Henderson <bryanh@giraffe.netgate.net>
The attached patch makes elog() write the message to stderr if there is
no frontend to talk to.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/error/elog.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 5acc371f01c..ba3174508c2 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.19 1997/09/08 02:31:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.20 1997/11/09 04:43:35 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -162,6 +162,12 @@ elog(int lev, const char *fmt,...) pq_putstr(line); pq_flush(); } + if (Pfout == NULL) { + /* There is no socket. One explanation for this is we are running + as the Postmaster. So we'll write the message to stderr. + */ + fputs(line, stderr); + } #endif /* !PG_STANDALONE */ if (lev == WARN) |