Unlisten / listen in a transaction failure
От | Greg Sabino Mullane |
---|---|
Тема | Unlisten / listen in a transaction failure |
Дата | |
Msg-id | 20130213145522.GI23404@broken.home обсуждение исходный текст |
Ответы |
Re: Unlisten / listen in a transaction failure
|
Список | pgsql-bugs |
I came across some unusual behavior with listen. Basically, if you=20 unlisten and listen inside of a transaction, new notices are not=20 picked up right away - but they will show up if you send yourself=20 a notice. It also works as expected if you unlisten, commit, and=20 then re-listen. Tested on 9.1 and 9.2. Demo psql script: listen abc; \t \! psql -p 5491 -c 'notify abc' select * from pg_listening_channels(); begin; unlisten *; listen abc; commit; \! psql -p 5491 -c 'notify abc' select * from pg_listening_channels(); notify abc; Output of above on 9.1 with psql -e: listen abc; LISTEN Showing only tuples. NOTIFY select * from pg_listening_channels(); abc Asynchronous notification "abc" received from server process with PID 10879. begin; BEGIN unlisten *; UNLISTEN listen abc; LISTEN commit; COMMIT NOTIFY select * from pg_listening_channels(); abc notify abc; NOTIFY Asynchronous notification "abc" received from server process with PID 10882. Asynchronous notification "abc" received from server process with PID 10876. --=20 Greg Sabino Mullane greg@endpoint.com End Point Corporation PGP Key: 0x14964AC8
В списке pgsql-bugs по дате отправления: