Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



There'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).


Sorry 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


I 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: