Re: notify problem - Mailing list pgsql-general

From Tom Lane
Subject Re: notify problem
Date
Msg-id 12203.1062772241@sss.pgh.pa.us
Whole thread Raw
In response to notify problem  (Alessandro GARDICH <gremlin@gremlin.it>)
List pgsql-general
Alessandro GARDICH <gremlin@gremlin.it> writes:
>    res = PQexec(conn, "LISTEN alert");

>    for(i = 0; i < 80 ; ++i) {
>       sleep(1);
>       PQconsumeInput(conn);
>       while ((notify = PQnotifies(conn)) != NULL) {
>          fprintf(stderr,"\nGOT NOTIFY!!!\n");
>          free(notify);
>       }
>       fprintf(stderr,".");
>    }

> On a console with psql I issue some notify with
> NOTIFY alert; COMMIT;
> but nothing are catched !!!

Hm.  Should I guess from the above that you've set autocommit off in
postgresql.conf?  If so, your problem is you didn't commit the LISTEN.
Notifications are not sent to clients that are in open transactions.

            regards, tom lane

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Replaceing records
Next
From: Stephan Szabo
Date:
Subject: Re: Optimizer picks an ineffient plan