Re: BUG #16258: exec_simple_query does not call ProcessCompletedNotifies after CommitTransactionCommand

From: RekGRpth <rekgrpth(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16258: exec_simple_query does not call ProcessCompletedNotifies after CommitTransactionCommand
Date: 2020-02-18 02:48:06
Message-ID: CAPgh2mKn8ZB_vsrjnS9JsYGDuKVa4nZ4D-2d6yiNK_pO67C8=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for the tip! I learned outer code of function exec_simple_query and
I seen "idle" condition of calling ProcessCompletedNotifies! In my postgres
job scheduler https://github.com/RekGRpth/pg_task I copied
exec_simple_query and modified it to call ProcessCompletedNotifies after
CommitTransactionCommand and it works!
with bst regrds, Rek>pth

сб, 15 февр. 2020 г. в 23:16, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>:

> On Sat, Feb 15, 2020 at 4:39 AM RekGRpth <rekgrpth(at)gmail(dot)com> wrote:
>
>>
>> And how about several transaction in new procedures?
>>
>
> That does seem like a legitimate gripe.
>
> create or replace procedure foo() LANGUAGE plpgsql as $$
> begin
> FOR i IN 1..100 LOOP
> perform pg_notify('channel','HI');
> perform pg_sleep(1);
> commit;
> end loop;
> end; $$;
> CALL foo();
>
> An actively polling listener gets all notification all at once at the
> end. (I just use psql with a "LISTEN channel;" and the repeatedly execute
> ";" to get it to poll)
>
> Cheers,
>
> Jeff
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2020-02-18 03:06:13 Re: PSQL Help
Previous Message Tom Lane 2020-02-17 22:22:24 Re: Possible memory leak in PostgreSQL 12.2 on truncate, insert or delete when type interval is involved