Re: Suggestions on message transfer among backends

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Euler Taveira <euler(at)timbira(dot)com(dot)br>, Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Suggestions on message transfer among backends
Date: 2019-03-12 00:07:48
Message-ID: 5C86F854.9080505@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/11/19 19:53, Euler Taveira wrote:
> Em seg, 11 de mar de 2019 às 10:36, Andy Fan
> <zhihui(dot)fan1213(at)gmail(dot)com> escreveu:
>>
>> I need some function which requires some message exchange among different back-ends (connections).
>> specially I need a shared hash map and a message queue.
>>
> It seems you are looking for LISTEN/NOTIFY. However, if it is part of

My own recollection from looking at LISTEN/NOTIFY is that, yes, it
offers a mechanism for message passing among sessions, but the message
/reception/ part is very closely bound to the frontend/backend protocol.

That is, a message sent in session B can be received in session A, but
it pretty much goes flying straight out the network connection to
/the connected client associated with session A/.

If you're actually working /in the backend/ of session A (say, in a
server-side PL), it seemed to be unexpectedly difficult to find a way
to hook those notifications. But I looked at it only briefly, and
some time ago.

Regards,
-Chap

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2019-03-12 01:32:10 Re: Special role for subscriptions
Previous Message Tom Lane 2019-03-12 00:03:40 Use nanosleep(2) in pg_usleep, if available?