Re: NOTIFY in multi-statement PQexec() not sent outside of transaction - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: NOTIFY in multi-statement PQexec() not sent outside of transaction
Date
Msg-id CAKFQuwb4OS74dBshrvB9Zu9V5ik5W2+5ja-tD0ieEK7LwZKWRQ@mail.gmail.com
Whole thread Raw
In response to NOTIFY in multi-statement PQexec() not sent outside of transaction  (John Muehlhausen <jgm@jgm.org>)
Responses Re: NOTIFY in multi-statement PQexec() not sent outside of transaction
List pgsql-bugs
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 by date:

Previous
From: Roman Peshkurov
Date:
Subject: Bug with memory leak on cert validation in libpq
Next
From: Tom Lane
Date:
Subject: Re: BUG #16378: Invalid memory access on interrupting CLUSTER after CREATE TEMP TABLE