Re: Notify enhancement - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Notify enhancement
Date
Msg-id 878xhnn1qj.fsf@enterprisedb.com
Whole thread Raw
In response to Re: Notify enhancement  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Andrew Dunstan <andrew@dunslane.net> writes:
>> Alvaro Herrera wrote:
>>> What will happen when the ring is full?  NOTIFY blocks?
>>> 
>> An error, I think, don't you? Blocking seems totally unacceptable.
>
> That seems like a curious answer.  Imagine the documentation:
> "NOTIFY may fail for no reason whatsoever."  I'd vote for blocking.
> Otherwise, apps have to treat NOTIFY as an unreliable communication
> mechanism, which reduces its use-case to approximately nil.

This will run into the same issue that bidirectional pipes run into with
deadlocks. The usual approach in Unix for dealing with this is having the
application always -- even while blocked trying to write -- read any pending
input and buffer it in user-space until it has enough to proceed. This may be
hard to arrange in SQL? I think you would need a way for a PL/pgsql to escape
a blocking write and read any pending notifications.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Notify enhancement
Next
From: Tom Lane
Date:
Subject: Re: Notify enhancement