From 1405d22a6b9625e42265c3cef348b788a153ff7a Mon Sep 17 00:00:00 2001 From: alterego655 <824662526@qq.com> Date: Fri, 24 Jul 2026 16:05:35 +0800 Subject: [PATCH v1 2/5] Fix WAIT FOR LSN documentation examples Pad example LSNs to match pg_lsn_out() output, and use "standby_replay LSN" in the timeout error to match the server message. --- doc/src/sgml/ref/wait_for.sgml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/ref/wait_for.sgml b/doc/src/sgml/ref/wait_for.sgml index cd5dd031991..01dc2a84a1a 100644 --- a/doc/src/sgml/ref/wait_for.sgml +++ b/doc/src/sgml/ref/wait_for.sgml @@ -301,7 +301,7 @@ UPDATE 100 postgres=# SELECT pg_current_wal_insert_lsn(); pg_current_wal_insert_lsn --------------------------- - 0/306EE20 + 0/0306EE20 (1 row) @@ -310,7 +310,7 @@ postgres=# SELECT pg_current_wal_insert_lsn(); changes made on primary should be guaranteed to be visible on replica. -postgres=# WAIT FOR LSN '0/306EE20'; +postgres=# WAIT FOR LSN '0/0306EE20'; status --------- success @@ -326,7 +326,7 @@ postgres=# SELECT * FROM movie WHERE genre = 'Drama'; Wait for flush (data durable on replica): -postgres=# WAIT FOR LSN '0/306EE20' WITH (MODE 'standby_flush'); +postgres=# WAIT FOR LSN '0/0306EE20' WITH (MODE 'standby_flush'); status --------- success @@ -338,7 +338,7 @@ postgres=# WAIT FOR LSN '0/306EE20' WITH (MODE 'standby_flush'); Wait for write with timeout: -postgres=# WAIT FOR LSN '0/306EE20' WITH (MODE 'standby_write', TIMEOUT '100ms', NO_THROW); +postgres=# WAIT FOR LSN '0/0306EE20' WITH (MODE 'standby_write', TIMEOUT '100ms', NO_THROW); status --------- success @@ -350,7 +350,7 @@ postgres=# WAIT FOR LSN '0/306EE20' WITH (MODE 'standby_write', TIMEOUT '100ms', Wait for flush on primary: -postgres=# WAIT FOR LSN '0/306EE20' WITH (MODE 'primary_flush'); +postgres=# WAIT FOR LSN '0/0306EE20' WITH (MODE 'primary_flush'); status --------- success @@ -362,8 +362,8 @@ postgres=# WAIT FOR LSN '0/306EE20' WITH (MODE 'primary_flush'); If the target LSN is not reached before the timeout, an error is thrown: -postgres=# WAIT FOR LSN '0/306EE20' WITH (TIMEOUT '0.1s'); -ERROR: timed out while waiting for target LSN 0/306EE20 to be replayed; current replay LSN 0/306EA60 +postgres=# WAIT FOR LSN '0/0306EE20' WITH (TIMEOUT '0.1s'); +ERROR: timed out while waiting for target LSN 0/0306EE20 to be replayed; current standby_replay LSN 0/0306EA60 @@ -372,7 +372,7 @@ ERROR: timed out while waiting for target LSN 0/306EE20 to be replayed; current NO_THROW option: -postgres=# WAIT FOR LSN '0/306EE20' WITH (TIMEOUT '100ms', NO_THROW); +postgres=# WAIT FOR LSN '0/0306EE20' WITH (TIMEOUT '100ms', NO_THROW); status --------- timeout -- 2.51.0