News for hackers. Stuff that matters.
Re:PostgREST – A fully RESTful API from any existing Postgre... by begriffs on Sunday March 26, 2017 @02:17AM (#13959496)
You can trigger external actions by connecting PostgreSQL pubsub (LISTEN/NOTIFY) with an external job queue. https://postgrest.com/en/v0.4/intro.html#external-notificati...

A NOTIFY SQL command can be sent out from either a stored procedure or a table trigger. (The docs could use some examples of this, but that's the idea.)

Re:PostgREST – A fully RESTful API from any existing Postgre... by gnud on Sunday March 26, 2017 @03:37AM (#13959668)
Be aware that Postgres' NOTIFY is not stored/queued in any way. If your external client is not listening, it will get lost.

I would instead have the trigger insert a row into a "pending tasks" table - and then send a NOTIFY.

Re:PostgREST – A fully RESTful API from any existing Postgre... by lima on Sunday March 26, 2017 @08:44AM (#13960468)
http://debezium.io/ is a better way to do this.

It uses the logical decoding feature to get all row changes and writes them to a Kafka queue.

This means it can pick up where it left when it crashes.

Re:PostgREST – A fully RESTful API from any existing Postgre... by ruslan_talpa on Sunday March 26, 2017 @11:58AM (#13961386)