Re: implementing asynchronous notifications - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: implementing asynchronous notifications
Date
Msg-id 425A11A9.8050406@opencloud.com
Whole thread Raw
In response to Re: implementing asynchronous notifications  (Andras Kadinger <bandit@surfnonstop.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Andras Kadinger
Date:
Subject: Re: implementing asynchronous notifications
Next
From: "Bruce Raggett"
Date:
Subject: Re: Version 8.0-310 and PreparedStatement.getParameterMetaData()