LISTEN query timeout with node-postgres?

后端 未结 2 1579
星月不相逢
星月不相逢 2021-02-15 11:20

I have an \"article\" table on a Postgresql 9.1 database and a trigger that notifies a channel on each insert.

I\'d like to create a node.js script that catches those in

2条回答
  •  一生所求
    2021-02-15 11:41

    LISTEN is supposed to last for the session lifetime or until you do UNLISTEN. So, as long as your code is running, notifications should be delivered. Note, that IIRC, postgresql gives no promises to deliver one notification per NOTIFY — if you have many inserts it may choose to deliver a single NOTIFY. Not sure about 9.1, they introduced LISTEN payload, so it may make a bit less sense.

提交回复
热议问题