Source time Edition date
PostgreSQL 19 Released
PostgreSQL 19 发布
PostgreSQL 19 matters most to database teams and extension authors, who must weigh the cost of validating extension compatibility before committing to the upgrade.
Judgment
Teams running read replicas must now decide whether to keep their hand-rolled read-your-writes shims or move the wait into PostgreSQL 19's WAIT FOR LSN — accepting an extra blocking round-trip and an optional timeout that raises an error when a standby lags.
Basis
Simon Willison calls WAIT FOR LSN his favorite feature of this release. A session on a standby issues the command with a log sequence number the primary returned — his example value is 0/0306EE20 — and the standby replays WAL up to that point before answering the query, so the application can read the write it just made on the primary. The LSN is stored somewhere, a signed cookie works, and the next request waits on it. The timeout is optional: supply one and you get an error if the replica does not catch up in time. Willison traces the pattern to Wikipedia, where MediaWiki hand-rolled it against MySQL replication and now uses MySQL's WAIT_FOR_EXECUTED_GTID_SET() with a SOURCE_POS_WAIT() fallback. He also notes the release landed two months after the usual September cadence, attributed mainly to the volume of AI-reported vulnerability issues the team had to work through.
- Primary returns LSN0/0306EE20
- Store LSN (cookie)next request
- Standby: WAIT FOR LSNafter replay
- Query sees own write
Unclear The source gives no figure for the latency added when a standby is lagging, and does not say whether the LSN survives connection poolers or can be waited on across several replicas.
Next Read the PostgreSQL 19 WAIT FOR LSN documentation for timeout defaults, then test whether PgBouncer in transaction pooling mode preserves the session that issues the wait.