News for hackers. Stuff that matters.
Re:All the ways to capture changes in Postgres by _acco on Friday September 22, 2023 @09:44AM (#37611981)
Any ideas for a simple polling implementation that's more robust?
Re:All the ways to capture changes in Postgres by qazxcvbnm on Friday September 22, 2023 @10:56AM (#37612885)
I've had pretty much the exact same problem and what I went for in my low-volume case was to simply add advisory locks such that I can guarantee the transaction start times provide correct ordering.
Re:All the ways to capture changes in Postgres by farsa on Friday September 22, 2023 @11:29AM (#37613339)
It's not exactly simple as it involves some postgres specific knowledge, but you can make it reliable when working with transaction ids (see https://event-driven.io/en/ordering_in_postgres_outbox/).
Re:All the ways to capture changes in Postgres by oconnore on Friday September 22, 2023 @03:54PM (#37616917)
Set the trigger to add the primary key + change time to a separate table, then scan/truncate that table to poll changes.