first commit
This commit is contained in:
8
ch04/psqlrc.conf
Normal file
8
ch04/psqlrc.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
\pset pager always
|
||||
\pset null 'NULL'
|
||||
\encoding latin1
|
||||
\set PROMPT1 '%n@%M:%>%x %/# '
|
||||
\set PROMPT2 ''
|
||||
\timing on
|
||||
\set qstats 'SELECT usename, datname, left(query,100) || ''...'' As query FROM pg_stat_activity WHERE state != ''idle'' ;'
|
||||
\pset pager always
|
||||
24
ch04/settings_report.psql
Normal file
24
ch04/settings_report.psql
Normal file
@@ -0,0 +1,24 @@
|
||||
\o settings_report.html
|
||||
\T 'cellspacing=0 cellpadding=0'
|
||||
\qecho '<html><head><style>H2{color:maroon}</style>'
|
||||
\qecho '<title>PostgreSQL Settings</title></head><body>'
|
||||
\qecho '<table><tr valign=''top''><td><h2>Planner Settings</h2>'
|
||||
\x on
|
||||
\t on
|
||||
\pset format html
|
||||
SELECT category, string_agg(name || '=' || setting, E'\n' ORDER BY name) As settings
|
||||
FROM pg_settings
|
||||
WHERE category LIKE '%Planner%' GROUP BY category ORDER BY category;
|
||||
\H
|
||||
\qecho '</td><td><h2>File Locations</h2>'
|
||||
\x off
|
||||
\t on
|
||||
\pset format html
|
||||
SELECT name, setting
|
||||
FROM pg_settings
|
||||
WHERE category = 'File Locations' ORDER BY name;
|
||||
\qecho '<h2>Memory Settings</h2>'
|
||||
SELECT name, setting, unit
|
||||
FROM pg_settings WHERE category ILIKE '%memory%' ORDER BY name;
|
||||
\qecho '</td></tr></table>'
|
||||
\qecho '</body></html>'
|
||||
Reference in New Issue
Block a user