Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c97495b

Browse files
authored
replication_lag query fixed
1 parent 14f16c9 commit c97495b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,11 +2504,12 @@ $ crontab -l
25042504
### Как узнать отставание реплики?
25052505

25062506
Запускать на реплике:
2507-
25082507
```sql
2509-
select now() - pg_last_xact_replay_timestamp() as replication_lag_interval,
2508+
select case when not pg_is_in_recovery() or pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() then '0'::interval
2509+
else now() - pg_last_xact_replay_timestamp()
2510+
end as replication_lag_interval,
25102511
current_setting('max_standby_archive_delay') as max_standby_archive_delay,
2511-
current_setting('max_standby_streaming_delay') as max_standby_streaming_delay
2512+
current_setting('max_standby_streaming_delay') as max_standby_streaming_delay;
25122513
```
25132514

25142515
### Как узнать процент достижения своего максимального значения для последовательностей?

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /