Skip to content
ChaiBytes

PostgreSQL 19 Released with New Read-Your-Writes Consistency Feature

The PostgreSQL team has released version 19, which includes a new WAIT FOR LSN command to improve data consistency for applications using standby servers [1].

By , Founder

1 min read

Share

What Happened

PostgreSQL 19 has been released [1]. While the PostgreSQL team typically ships a new release in September, this year’s release arrived two months later than usual [1]. According to Simon Willison, the delay was due to the team needing to address a large number of issues related to ongoing AI-reported vulnerabilities [1].

A significant new feature in this release is the addition of “read-your-writes” consistency for applications that send read requests to standby servers [1]. This is achieved through a new command called WAIT FOR LSN [1].

How the WAIT FOR LSN command works:

  • A session on a standby server can use this command to wait until the standby has replayed the write-ahead log (WAL) up to a specific log sequence number (LSN) [1].
  • The command returns a value, such as 0/0306EE20 [1].
  • An application can store this value (for example, in a signed cookie) and use it in a subsequent request [1].
  • If a user provides a timeout, the system will return an error if the replica does not catch up within that specified time [1].

This functionality allows an application to ensure it reads data that it has just written on the primary server [1]. This pattern is similar to how MediaWiki manages consistency using MySQL replication functions like WAIT_FOR_EXECUTED_GTID_SET() or SOURCE_POS_WAIT() [1].

Regarding cloud usage, Amazon Aurora provides database engine updates for Aurora PostgreSQL [2]. For those using Amazon Aurora, the release of an Aurora PostgreSQL engine typically involves two version numbers: the database engine version and the Aurora version number [2]. Aurora version numbers follow a major.minor.patch naming scheme [2]. Users can minimize downtime during a database cluster upgrade by using blue/green deployments [2]. For versions of PostgreSQL from 10 onwards, the engine uses a major.minor numbering scheme [2]. For example, versions include 10.18, 12.7, and 13.3 [2]. Starting with PostgreSQL versions 10, 11.13, 12.8, and 13.3, Aurora version numbers align more closely with the PostgreSQL engine version [2].

About the author

, Founder

Sources

  1. PostgreSQL 19 Released — Simon Willison
  2. Database engine updates for Amazon Aurora PostgreSQL - Amazon Aurora — AWS Official source

Drafted with AI assistance from the reports above and checked automatically for sourcing. Always confirm dates, fees and requirements on the official website before acting. Report an error · How we correct mistakes

Was this helpful?

Questions or something to add?

Ask below. We read every comment and reply when we can.

Leave a comment

Be respectful. Comments with links are reviewed before they appear. Your email is used only to contact you about your comment, such as a reply from the editor.