Re: implementing asynchronous notifications

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Andras Kadinger <bandit(at)surfnonstop(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: implementing asynchronous notifications
Date: 2005-04-11 05:56:57
Message-ID: 425A11A9.8050406@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Raggett 2005-04-11 11:01:50 Re: Version 8.0-310 and PreparedStatement.getParameterMetaData()
Previous Message Andras Kadinger 2005-04-11 05:31:18 Re: implementing asynchronous notifications