pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Andras Kadinger <bandit@surfnonstop.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: implementing asynchronous notifications
Date: Mon, 11 Apr 2005 17:56:57 +1200
Message-ID: <425A11A9.8050406@opencloud.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0504110716400.21928-200000@ns.surfnonstop.com>
References: <Pine.LNX.4.44.0504110716400.21928-200000@ns.surfnonstop.com>

Andras Kadinger wrote:
> On Mon, 11 Apr 2005, Oliver Jowett wrote:
> 
>>You also need to handle errors ('E'). Try shutting down a postmaster (-m
>>fast) while idle connections are around -- they'll get spontaneous FATAL
>>errors.
> 
> 
> Are you certain? The protocol documentations specifically mentions this 
> case, saying it would send a NoticeResponse:
> 
> "It is possible for NoticeResponse messages to be generated due to outside 
> activity; for example, if the database administrator commands a "fast" 
> database shutdown, the backend will send a NoticeResponse indicating this 
> fact before closing the connection. Accordingly, frontends should always 
> be prepared to accept and display NoticeResponse messages, even when the 
> connection is nominally idle." - 
> http://www.postgresql.org/docs/8.0/static/protocol-flow.html#PROTOCOL-ASYNC
> 
> Still, I took your word on this now, and added code to handle 'E's.

This is what I get from a pg_ctl stop -m fast on 8.0.0:

recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating connection due to
administrator command\0Fpostgres.c\0L2042\0RProcessInterrupts\0\0",
8192, 0, NULL, NULL) = 110

I guess the docs are out of sync..

-O



view thread (10+ messages)  latest in thread

Message-ID: <425A11A9.8050406@opencloud.com>
Permalink:  ../425A11A9.8050406@opencloud.com/
Also on:    postgresql.org/message-id/425A11A9.8050406@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, bandit@surfnonstop.com
  Subject: Re: implementing asynchronous notifications
  In-Reply-To: <425A11A9.8050406@opencloud.com>
  References: <Pine.LNX.4.44.0504110716400.21928-200000@ns.surfnonstop.com> <425A11A9.8050406@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox