Re: NOTIFY in multi-statement PQexec() not sent outside of transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Muehlhausen <jgm(at)jgm(dot)org>
Cc: "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: NOTIFY in multi-statement PQexec() not sent outside of transaction
Date: 2020-04-20 19:42:00
Message-ID: 14161.1587411720@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

John Muehlhausen <jgm(at)jgm(dot)org> writes:
> Wrapping the notify in a transaction does not fix it. Shouldn't the notify
> be available as soon as the containing transaction is committed?

A notify message will be sent to the client when the backend is
(a) idle (*not* in the middle of processing a transaction string) and
(b) not in an open transaction.

You appear to be unhappy with point (a), but I think changing that
would break more clients than it fixes. It's intentional that
we don't send notifies mid-command, and this sure looks like a
variant of mid-command from here.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John Muehlhausen 2020-04-20 19:56:33 Re: NOTIFY in multi-statement PQexec() not sent outside of transaction
Previous Message John Muehlhausen 2020-04-20 19:32:05 Re: NOTIFY in multi-statement PQexec() not sent outside of transaction