Re: Suggestions on message transfer among backends - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: Suggestions on message transfer among backends
Date
Msg-id 5C86F854.9080505@anastigmatix.net
Whole thread Raw
In response to Re: Suggestions on message transfer among backends  (Euler Taveira <euler@timbira.com.br>)
List pgsql-hackers
On 03/11/19 19:53, Euler Taveira wrote:
> Em seg, 11 de mar de 2019 às 10:36, Andy Fan
> <zhihui.fan1213@gmail.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Use nanosleep(2) in pg_usleep, if available?
Next
From: Jeff Davis
Date:
Subject: Re: Special role for subscriptions