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