4 ms·
NOTIFY is transaction-safe: if the NOTIFY-ing transaction rolls back, the NOTIFY will not be delivered. See the discussion here ("NOTIFY interacts with SQL tran
by neilc 10y ago
NOTIFY is transaction-safe: if the NOTIFY-ing transaction rolls back, the NOTIFY will not be delivered. See the discussion here ("NOTIFY interacts with SQL transactions in some important ways..."):
https://www.postgresql.org/docs/9.6/static/sql-notify.html https://www.postgresql.org/docs/9.6/static/sql-notify.html
- deleted 10y ago[deleted]
- crad 10y agoYup, my bad, thanks. I confused the two problems I worked through in working through my use case. The transaction safety one was not the NOTIFY version of the project. That had different issues, which I need to go back and look at my notes for. My memory is a bit hazy, but IIRC we were seeing notifications dropped under high velocities and needed delivery guarantees.
- netghost 10y agoI seem to remember that when it was first implemented there was a fairly small buffer for queued messages. That might have contributed to your problem. The docs say it's 8GB by default now, which is probably sufficient.
- williamstein 10y agoMessages are limited to 8KB, so if the buffer is 8GB, that's a lot of messages that can be queued up.
- masklinn 10y agoThe original NOTIFY also didn't have a payload (that was added in PG9) which made it much harder to know what you were notified about. That one simple addition made pre-9.0 NOTIFY and post-9.0 NOTIFY completely different beasts.