PostgreSQL 19 Released
PostgreSQL 19's WAIT FOR LSN command lets apps read their own writes from replicas without hand-rolling the consistency logic MediaWiki has maintained for years.
The PostgreSQL database has released version 19, delayed about two months past its usual September slot because the team was busy fixing security problems, some of them reported via AI. The headline feature is called WAIT FOR LSN: it lets an application that reads from a backup copy of the database wait until that backup has caught up with the latest changes before answering. That means users see their own updates immediately instead of stale data. It is built into the database now, where apps like Wikipedia previously had to write this logic themselves.
PostgreSQL 19 shipped in November 2026 rather than its usual September, because the team was consumed by a wave of security vulnerabilities, some surfaced through AI-reported reports. For teams running read-heavy apps on replicated databases, the release removes a class of custom code: read-after-write consistency is now a built-in command with an optional timeout, rather than an in-house workaround. No migration risk or licensing change is mentioned.
PostgreSQL 19 adds WAIT FOR LSN: a standby session blocks until the standby has replayed the write-ahead log up to a supplied log sequence number, with optional WITH (TIMEOUT) that errors if the replica fails to catch up in time. Pattern: run the write on the primary, capture the returned LSN (e.g. 0/0306EE20) in a signed cookie, then WAIT FOR LSN before reading on the standby. This replicates the session-level binlog-position tracking MediaWiki implements against MySQL using WAIT_FOR_EXECUTED_GTID_SET() and SOURCE_POS_WAIT().