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 0179cc4

Browse files
authored
started_at, loaded_at added
1 parent 1f5f7f5 commit 0179cc4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎psqlrc/psqlrc‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ select -- pg_backend_pid(), -- if we're connecting through pgbouncer, then promp
4949

5050
pg_is_in_recovery(), -- primary or standby
5151

52+
pg_postmaster_start_time()::timestamptz(0) as started_at,
53+
pg_conf_load_time()::timestamptz(0) as loaded_at,
54+
now()::timestamptz(0) - pg_postmaster_start_time()::timestamptz(0) as start_uptime,
55+
now()::timestamptz(0) - pg_conf_load_time()::timestamptz(0) as load_uptime,
56+
5257
current_setting('server_version') as server_version,
5358
current_setting('config_file') as config_file,
5459
current_setting('hba_file') as hba_file,
@@ -121,6 +126,9 @@ from coalesce(
121126
extract(epoch from r.lag) as e(epoch)
122127
\gset
123128

129+
\echo :white'Started at: ':started_at' (':start_uptime')':reset
130+
\echo :white'Loaded at: ':loaded_at' (':load_uptime')':reset
131+
124132
\if :is_config_file_error
125133
\echo :red'Errors found in config file "':config_file'"':reset
126134

0 commit comments

Comments
(0)

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