PostgreSQL 19: WAIT FOR LSN

The new Postgres release brings "read-your-writes": a standby server (replica) can wait until it has received your latest write before answering a query. It shipped two months later than usual because of a wave of AI-discovered vulnerabilities.

How to try it

  1. Run it locally via Docker (official postgres image; check the link to see whether 19 is out yet)
  2. After a write, grab the position with SELECT pg_current_wal_insert_lsn();
  3. On the replica, run WAIT FOR LSN '<value>' WITH (TIMEOUT '0.1s'); and only then SELECT

Price: free

Official link

More new tools