The reference page and the read-your-writes section both presented WAIT in standby_replay mode as enough for read-your-writes, without saying which LSN to wait for. Read as written, an LSN taken after the last statement but before COMMIT would do, and it would not: the standby position WAIT compares against is the end of the last replayed record, so a target that falls inside the COMMIT record is satisfied while that record is still unapplied. Say that the target must be at or after the end of the write transaction's COMMIT record, and note in the example that autocommit is what puts the UPDATE's commit before the call that reads the position. Author: Sami Imseih <samimseih.pg@gmail.com> Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com> Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com> Discussion: https://postgr.es/m/CAN12%2BYKN7gXb1o9bDWgfA%3D6wjDrqNEgt%2BrXJiAWXgPCXQ5TqpA%40mail.gmail.com Backpatch-through: 19
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.