Re: "unexpected EOF" messages
| От | Robert Haas | 
|---|---|
| Тема | Re: "unexpected EOF" messages | 
| Дата | |
| Msg-id | CA+TgmoaZ7D2_U1Z8Vyd+ef9fGOG-YBQRaascBNSM_biyrZ_A5Q@mail.gmail.com обсуждение исходный текст | 
| Ответ на | Re: "unexpected EOF" messages (Magnus Hagander <magnus@hagander.net>) | 
| Ответы | Re: "unexpected EOF" messages | 
| Список | pgsql-hackers | 
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
		
	В списке pgsql-hackers по дате отправления: