aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/fastpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/fastpath.c')
-rw-r--r--src/backend/tcop/fastpath.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c
index 8506b1d60f2..5c0620689e3 100644
--- a/src/backend/tcop/fastpath.c
+++ b/src/backend/tcop/fastpath.c
@@ -285,9 +285,22 @@ HandleFunctionRequest(StringInfo msgBuf)
{
if (GetOldFunctionMessage(msgBuf))
{
- ereport(COMMERROR,
- (errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("unexpected EOF on client connection")));
+ if (IsTransactionState())
+ ereport(COMMERROR,
+ (errcode(ERRCODE_CONNECTION_FAILURE),
+ errmsg("unexpected EOF on client connection with an open transaction")));
+ else
+ {
+ /*
+ * Can't send DEBUG log messages to client at this point.
+ * Since we're disconnecting right away, we don't need to
+ * restore whereToSendOutput.
+ */
+ whereToSendOutput = DestNone;
+ ereport(DEBUG1,
+ (errcode(ERRCODE_CONNECTION_DOES_NOT_EXIST),
+ errmsg("unexpected EOF on client connection")));
+ }
return EOF;
}
}