|
35 | 35 | \pset null '¤' |
36 | 36 |
|
37 | 37 | \pset pager always |
38 | | - |
39 | | -\if `command -v pspg &> /dev/null && echo 1 || echo 0` |
40 | | - \pset expanded off |
41 | | - \setenv PAGER 'pspg --reprint-on-exit --blackwhite' |
42 | | -\else |
43 | | - \pset expanded auto |
44 | | - \setenv PAGER 'less -iMFXSx4R' |
45 | | - \echo :white'Using alternative psql pager called "pspg" is highly recommended (but not required): https://github.com/okbob/pspg':reset |
46 | | -\endif |
| 38 | +\pset expanded auto |
| 39 | +\setenv PAGER 'less -iMFXSx4R' |
47 | 40 |
|
48 | 41 | select -- pg_backend_pid(), -- If we're connecting through pgbouncer, then prompt's %p is not real, so get real PID |
49 | 42 | pg_is_in_recovery(), -- primary or standby |
@@ -81,6 +74,29 @@ from coalesce(case when not pg_is_in_recovery() then null -- not standby |
81 | 74 | extract(epoch from r.lag) as e(epoch) |
82 | 75 | \gset |
83 | 76 |
|
| 77 | +\if :pg_file_settings_error_count |
| 78 | + \echo :red'Errors found in config files:':reset |
| 79 | + with t as ( |
| 80 | + select distinct on (name) * |
| 81 | + from pg_file_settings |
| 82 | + order by name, seqno desc |
| 83 | + ) |
| 84 | + select t.sourcefile, |
| 85 | + t.sourceline, |
| 86 | + t.name, |
| 87 | + t.setting, |
| 88 | + t.applied, |
| 89 | + t.error, |
| 90 | + s.vartype, |
| 91 | + s.min_val, |
| 92 | + s.max_val, |
| 93 | + s.enumvals, |
| 94 | + s.extra_desc |
| 95 | + from t |
| 96 | + join pg_settings as s on t.name = s.name |
| 97 | + where not applied; |
| 98 | +\endif |
| 99 | + |
84 | 100 | /* psql escape codes: |
85 | 101 | %M - full host + domain for db server, or [local] (if over Unix socket), or [local:/dir/name] |
86 | 102 | %m - host name of the db server, truncated at the first dot, or [local] (if over Unix socket) |
@@ -108,6 +124,14 @@ from coalesce(case when not pg_is_in_recovery() then null -- not standby |
108 | 124 |
|
109 | 125 | \set PROMPT2 '' |
110 | 126 |
|
| 127 | +\if `command -v pspg &> /dev/null && echo 1 || echo 0` |
| 128 | + \echo '"pspg" pager is used' |
| 129 | + \pset expanded off |
| 130 | + \setenv PAGER 'pspg --reprint-on-exit --blackwhite' |
| 131 | +\else |
| 132 | + \echo :white'Using alternative psql pager called "pspg" is highly recommended (but not required): https://github.com/okbob/pspg':reset |
| 133 | +\endif |
| 134 | + |
111 | 135 | -- Show query execution time |
112 | 136 | \timing on |
113 | 137 |
|
|
0 commit comments