Re: NOTIFY in Background Worker
От | Thomas Munro |
---|---|
Тема | Re: NOTIFY in Background Worker |
Дата | |
Msg-id | CAEepm=2jP7RzLNVt2vAyV0XojF5PEJ64Ltb64hnW5GVHd=S0JA@mail.gmail.com обсуждение исходный текст |
Ответ на | NOTIFY in Background Worker (jacques klein <jacques.klei@googlemail.com>) |
Ответы |
Re: NOTIFY in Background Worker
|
Список | pgsql-hackers |
On Fri, Aug 28, 2015 at 10:30 PM, jacques klein <jacques.klei@googlemail.com> wrote:
That's because ProcessCompletedNotifies isn't being called. For regular backends it is called inside the top level loop PostgresMain. I think you need to include "commands/async.h" and add a call to ProcessCompletedNotifies() after your background worker commits to make this work.
Hello,
I added a "NOFITY chan" to the SQL arg of an SPI_execute(), (I did it also with just the NOTIFY statement),
but the listeners (other workers) don't get the notification until a "NOTIFY chan" is done for example with pgadmin,
They don't get lost, just not emited after the "not forgotten" call of CommitTransactionCommand().
Is this normal ( i.e. not supported (yet) ), a bug, or did I overlook some doc. (or source code) ?.
For now, I will try to "emit" the NOTIFY via libpq.
That's because ProcessCompletedNotifies isn't being called. For regular backends it is called inside the top level loop PostgresMain. I think you need to include "commands/async.h" and add a call to ProcessCompletedNotifies() after your background worker commits to make this work.
Thomas Munro
http://www.enterprisedb.com
http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: