Skip to content

Commit 6ccb2af

Browse files
committed
Remove error report from pq_endmessage when pq_putmessage fails. The
only possible failure is in pq_flush, which will log a (better!) report anyway --- so pq_endmessage is just cluttering the log with a redundant entry. This matters when a client crashes partway through a large query, since we will emit many broken-pipe reports before finishing the query and exiting.
1 parent c8e05af commit 6ccb2af

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/backend/libpq/pqformat.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1717
* Portions Copyright (c) 1994, Regents of the University of California
1818
*
19-
* $Id: pqformat.c,v 1.16 2001/01/24 19:42:56 momjian Exp $
19+
* $Id: pqformat.c,v 1.17 2001/04/16 01:46:57 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -213,13 +213,8 @@ pq_sendint(StringInfo buf, int i, int b)
213213
void
214214
pq_endmessage(StringInfo buf)
215215
{
216-
if (pq_putmessage('\0', buf->data, buf->len))
217-
{
218-
snprintf(PQerrormsg, PQERRORMSG_LENGTH,
219-
"FATAL: pq_endmessage failed: errno=%d\n", errno);
220-
fputs(PQerrormsg, stderr);
221-
pqdebug("%s", PQerrormsg);
222-
}
216+
(void) pq_putmessage('\0', buf->data, buf->len);
217+
/* no need to complain about any failure, since pqcomm.c already did */
223218
pfree(buf->data);
224219
buf->data = NULL;
225220
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy