Re: notification: pg_notify ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Mikhail Terekhov <terekhov(at)emc(dot)com>, pgsql-hackers(at)postgresql(dot)org, Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Subject: Re: notification: pg_notify ?
Date: 2002-04-03 15:37:07
Message-ID: 9364.1017848227@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
>> Because there is no other easy way to guarantee message delivery?

> Shared memory is much easier and, to all intents and purposes, as reliable
> for this kind of usage. It is much faster and is the-right-way-to-do-it.

Right. Since we do not attempt to preserve NOTIFY messages over a
system crash, there's no good reason to keep the messages in a table.
Except for the problem that shared memory is of limited size.
But if we are willing to define the semantics in a way that allows
buffer overflow recovery, that can be dealt with.

> A buffer overrun (rare as it would be,
> considering the different usage patterns of the shared memory for
> notification) would result in an elog(ERROR) from within the backend which
> has attempted to execute the notification.

Hmm. That's a different way of attacking the overflow problem. I don't
much care for it, but I can see that some applications might prefer this
behavior to cache-style overrun response (ie, issue forced NOTIFYs on
all conditions). Maybe support both ways?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Sullivan 2002-04-03 15:41:00 Re: [HACKERS] Re : Solaris Performance - Profiling (Solved)
Previous Message Tom Lane 2002-04-03 15:28:22 Re: maxint reached?