On Mon, May 7, 2012 at 12:39 PM, Magnus Hagander <magnus@hagander.net> wrote:
> Makes sense, will change and commit.
Since the following hunk is repeated 3x, maybe it should be stuffed
into a function that is then called in three places:
+ 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")));
+ }
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company