Re: NOTIFY/LISTEN why is not a callback as notice processing.

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: NOTIFY/LISTEN why is not a callback as notice processing.
Date: 2010-11-11 13:21:54
Message-ID: AANLkTi=+kMBXDao9Z4BU+m37n9kg-Vx9LCwgXe8To2NK@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 10, 2010 at 5:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Not in libpq.  libpq is just a passive library, it can't cause actions
> to happen when you aren't calling it.  So there's no point in a
> callback: you might as well just test for occurrences of a NOTIFY at
> times when you're prepared to handle it.
>

On my systems where I use them more or less as "wakeup and do work"
signals, I just do a select() call on the connection socket. When the
signal arrives, the socket becomes readable, and then I just query for
the notification.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rhys A.D. Stewart 2010-11-11 13:23:26 Re: ignore errors for COPY
Previous Message Vick Khera 2010-11-11 13:17:35 Re: 2PC w/ dblink