WAITLSN

WAITLSN — ожидать воспроизведения целевого LSN

Синтаксис

WAITLSN 'LSN' [ , время_ожидания ]

Описание

WAITLSN предоставляет простой межпроцессный механизм ожидания целевого LSN (последовательного номера записи в журнале) на ведомых узлах в схемах асинхронной репликации ведущий-ведомый Postgres Pro. При выполнении с указанием LSN команда WAITLSN ждёт воспроизведения данного LSN. По умолчанию время ожидания неограниченно. Ожидание можно прервать, нажав Ctrl+C или остановив сервер postgres. Также его можно ограничить, указав время_ожидания в миллисекундах.

Важно

Оператор WAITLSN считается устаревшим.

Параметры

LSN

Указывает последовательный номер записи в журнале, воспроизведение которой ожидается.

время_ожидания

Ограничивает время ожидания воспроизведения LSN. В параметре время_ожидания указывается целое число миллисекунд.

Примеры

Выполнение WAITLSN в psql с ограничением времени до 10000 миллисекунд:

WAITLSN '0/3F07A6B1', 10000;
NOTICE:  LSN is not reached. Try to make bigger delay.
WAITLSN

Ожидание воспроизведения указанного LSN:

WAITLSN '0/3F07A611';
WAITLSN
-------------
 t
(1 row)

Ограничение времени ожидания LSN до 500000 миллисекунд и отмена команды:

WAITLSN '0/3F0FF791', 500000;
^CCancel request sent
NOTICE:  LSN is not reached. Try to make bigger delay.
ERROR:  canceling statement due to user request

Совместимость

Оператор WAITLSN отсутствует в стандарте SQL.

WAITLSN

WAITLSN — wait for the target LSN to be replayed

Synopsis

WAITLSN 'LSN' [ , wait_time ]

Description

WAITLSN provides a simple interprocess communication mechanism to wait for the target log sequence number (LSN) on standby in Postgres Pro databases with master-standby asynchronous replication. When run with the LSN option, the WAITLSN command waits for the specified LSN to be replayed. By default, wait time is unlimited. Waiting can be interrupted using Ctrl+C, or by shutting down the postgres server. You can also limit the wait time specifying the wait_time option, in milliseconds.

Important

The 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

Run WAITLSN from psql, limiting wait time to 10000 milliseconds:

WAITLSN '0/3F07A6B1', 10000;
NOTICE:  LSN is not reached. Try to make bigger delay.
WAITLSN

Wait until the specified LSN is replayed:

WAITLSN '0/3F07A611';
WAITLSN
-------------
 t
(1 row)

Limit LSN wait time to 500000 milliseconds, and then cancel the command:

WAITLSN '0/3F0FF791', 500000;
^CCancel request sent
NOTICE:  LSN is not reached. Try to make bigger delay.
ERROR:  canceling statement due to user request

Compatibility

There is no WAITLSN statement in the SQL standard.

FAQ