WAITLSN
WAITLSN — wait for the targetLSN to be replayed
Synopsis
WAITLSN'LSN'
[ ,wait_time
]
Description
TheWAITLSN
provides a simple interprocess communication mechanism to wait for the target log sequence number (LSN) on standby inPostgres Pro databases with master-standby asynchronous replication. When run with theLSN
option, theWAITLSN
command waits for the specifiedLSN to be replayed. By default, wait time is unlimited. Waiting can be interrupted usingCtrl+C
, or by shutting down thepostgres
server. You can also limit the wait time specifying thewait_time
option, in milliseconds.Important
WAITLSN
command is deprecated.
Parameters
LSN
Specify the target log sequence number to wait for.
wait_time
Limit the time to wait for the LSN to be replayed. The specified
wait_time
must be an integer and is measured in milliseconds.
Examples
RunWAITLSN
frompsql, limiting wait time to 10000 milliseconds:
WAITLSN '0/3F07A6B1', 10000;NOTICE: LSN is not reached. Try to make bigger delay.WAITLSN
Wait until the specifiedLSN is replayed:WAITLSN '0/3F07A611';WAITLSN------------- t(1 row)
Compatibility
There is noWAITLSN
statement in the SQL standard.