Gregory Stark <stark@enterprisedb.com> writes:
> 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.
None of that is any different from the situation with sinval
messaging.
Note BTW that writes to the buffer will happen only in a very
circumscribed place (at COMMIT) so your worries about plpgsql
seem misplaced.
regards, tom lane