The WAIT FOR docs say that "The standby_replay mode waits for the LSN to be replayed (applied to the database), which is useful to achieve read-your-writes consistency while using an async replica for reads and the primary for writes."
I think that needs one more caveat. WAIT FOR success does not guarantee read-your-writes if the supplied LSN is before the transaction's COMMIT record. Maybe the last sentence should be qualified with: " .... the primary for writes, provided that the target LSN was captured after COMMIT on the primary." This may be obvious to users of this feature, but perhaps worth being more explicit about it. Thoughts? -- Sami Imseih Amazon Web Services (AWS)
