3 ms·
Yeah I also used triggers at the start. There are 2 things that this implementation achieve over triggers. 1. Triggers have an 8000 byte limit. I ran against t
by kiwicopple 7y ago
Yeah I also used triggers at the start. There are 2 things that this implementation achieve over triggers.
1. Triggers have an 8000 byte limit. I ran against these limits pretty quickly
2. You need to attach the trigger each time you create a new table. With this you can set and forget
- anarazel 7y agoThere's no 8k limit with triggers? Could you expect on what you mean by that? One of the motivating factors for not using triggers is that the implied overhead is very significant. By logging changes separately which triggers the write volume is roughly doubled, and the overhead of insertions is much much higher (a lot of fast/bulk path can't be used, the trigger processing needs to be performed).
- kiwicopple 7y agoSorry I meant I was using triggers to sent a NOTIFY which has an 8k byte limit. Very true what you mention about trigger overhead. Also you don’t get guaranteed atomicity
- numtel 7y agoI wrote a node.js package a few years ago that gets past the 8000 bytes by sending multiple notifications. https://github.com/numtel/pg-live-select https://github.com/numtel/pg-live-select