Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 213d7b1

Browse files
committed
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.
1 parent 8d0fe2d commit 213d7b1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/utils/error/elog.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.19 1997/09/08 02:31:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.20 1997/11/09 04:43:35 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -162,6 +162,12 @@ elog(int lev, const char *fmt,...)
162162
pq_putstr(line);
163163
pq_flush();
164164
}
165+
if (Pfout == NULL) {
166+
/* There is no socket. One explanation for this is we are running
167+
as the Postmaster. So we'll write the message to stderr.
168+
*/
169+
fputs(line, stderr);
170+
}
165171
#endif /* !PG_STANDALONE */
166172

167173
if (lev == WARN)

0 commit comments

Comments
 (0)