Re: select + PQnotifies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Leigh <james(dot)leigh(at)ottawa(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select + PQnotifies
Date: 2002-02-01 18:33:07
Message-ID: 11231.1012588387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James Leigh <james(dot)leigh(at)ottawa(dot)com> writes:
> I have been having some trouble with using PQnotifies and the select
> function. When I run the program below, the select function returns
> early (before 5sec) when I send it a notify; but once the select
> function runs out the first time (after 5sec), then no matter how many
> time I send anotify the select does not return until after the full 5
> secs.

You're forgetting that the rdfs parameter to select() is a read/write
parameter. You need to set the bit for the file you're interested in
every time through the loop, not just once.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joep deVocht 2002-02-01 21:28:08 Few questions
Previous Message James Leigh 2002-02-01 17:49:48 select + PQnotifies