PostgreSQL 19’s WAIT FOR LSN lets an application record a primary WAL position at or after commit and wait on a standby before reading. Default replay mode waits until the changes are applied; receipt or durable flush alone is insufficient.

WAIT cannot hold a snapshot or a lock while waiting for an unreached target: replay could need those resources. It also compares numeric LSNs without checking the WAL timeline, leaving the application responsible for history changes after promotion. Default waiting is indefinite; set a timeout and check the returned status when using NO_THROW. Logical sequence replication and pg_plan_advice are separate additions.

www.postgresql.org