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 e0da5ce

Browse files
authored
:pg_file_settings_error_count added
1 parent 98051b7 commit e0da5ce

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎psqlrc/psqlrc‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,22 @@ select -- pg_backend_pid(), -- If we're connecting through pgbouncer, then pr
3434
when epoch < 60.0 then round(extract(second from lag)::numeric, 1) || 's'
3535
when epoch < 3600.0 then round(extract(second from lag)::numeric, 0) || 's'
3636
end
37-
), ''), '?') as replication_lag
37+
), ''), '?') as replication_lag,
38+
(with t as (
39+
select distinct on (name) *
40+
from pg_file_settings
41+
order by name, seqno desc
42+
)
43+
select count(*)
44+
from t
45+
join pg_settings as s on t.name = s.name
46+
where not applied) as pg_file_settings_error_count
3847
from coalesce(case when not pg_is_in_recovery() then null -- not standby
3948
when not exists(select from pg_stat_wal_receiver) then null -- primary lost
4049
when pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() then '0'::interval -- no lag
4150
else now() - pg_last_xact_replay_timestamp()
4251
end) as r(lag),
43-
extract(epoch from lag) as e(epoch)
52+
extract(epoch from r.lag) as e(epoch)
4453
\gset
4554

4655
/* psql escape codes:

0 commit comments

Comments
(0)

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