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

Поиск
Список
Период
Сортировка
От John Muehlhausen
Тема Re: NOTIFY in multi-statement PQexec() not sent outside of transaction
Дата
Msg-id CACk8hr6qGF78Vo7i7+mvgXqy3AMoOXAkxbCMbGwxwNOf9dpw2Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: NOTIFY in multi-statement PQexec() not sent outside of transaction  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: NOTIFY in multi-statement PQexec() not sent outside of transaction  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Wrapping the notify in a transaction does not fix it.  Shouldn't the notify be available as soon as the containing transaction is committed?

cur.execute(("begin; notify __test; commit; "
                "begin; select pg_advisory_lock(7777); "
                "select pg_advisory_unlock(7777); commit"))


On Mon, Apr 20, 2020 at 1:26 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Monday, April 20, 2020, John Muehlhausen <jgm@jgm.org> wrote:

# docs seem to indicate that an implied transaction
# will not exist if there is an explicit begin/commit?
cur.execute(("notify __test; "
"begin; select pg_advisory_lock(7777); "
"select pg_advisory_unlock(7777); commit"))


A more comprehensive reading of the docs finds:

“ If the BEGIN follows some statements that were executed as an implicit transaction block, those statements are not immediately committed; in effect, they are retroactively included into the new regular transaction block. “.

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16112: large, unexpected memory consumption
Следующее
От: Tom Lane
Дата:
Сообщение: Re: NOTIFY in multi-statement PQexec() not sent outside of transaction