File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change
1
+ select case when pg_is_in_recovery() then ' Replica' || ' (delay: '
2
+ || ((((case
3
+ when pg_last_xlog_receive_location() = pg_last_xlog_replay_location() then 0
4
+ else extract (epoch from now() - pg_last_xact_replay_timestamp())
5
+ end)::int )::text || ' second' )::interval)::text
6
+ || ' ; paused: ' || pg_is_xlog_replay_paused()::text || ' )'
7
+ else ' Master'
8
+ end as " Node Information" ;
Original file line number Diff line number Diff line change 1
1
\echo Menu:
2
- \echo ' 1 – Database object sizes '
2
+ \echo ' 1 – Master / replica info (with lag) '
3
3
\echo ' 2 – Bloat'
4
4
\echo ' 3 – pg_stat_statementis'
5
5
\echo ' q – Quit from this tool'
@@ -13,20 +13,21 @@ select
13
13
:d_stp::text = '3' as d_step_is_3,
14
14
:d_stp::text = 'q' as d_step_is_q \gset
15
15
\if :d_step_is_1
16
- \echo ' 1 is chosen!'
16
+ \i ./general/basic.sql
17
17
\prompt 'Press any key…' d_dummy
18
- \i index.sql
18
+ \i ./ index.psql
19
19
\elif :d_step_is_2
20
20
\echo ' 2 is chosen!'
21
21
\prompt 'Press any key…' d_dummy
22
- \i index.sql
22
+ \i ./ index.psql
23
23
\elif :d_step_is_3
24
24
\echo ' 3 is chosen!'
25
25
\prompt 'Press any key…' d_dummy
26
- \i index.sql
26
+ \i ./ index.psql
27
27
\elif :d_step_is_q
28
28
\echo '...bye!'
29
29
\else
30
30
\echo 'ERROR: Unkown option!'
31
- \i index.sql
31
+ \i ./ index.psql
32
32
\endif
33
+
You can’t perform that action at this time.
0 commit comments