first commit

This commit is contained in:
Regina Obe
2026-01-02 11:42:04 -05:00
commit 1bc9a9b4be
4 changed files with 510954 additions and 0 deletions

8
ch04/psqlrc.conf Normal file
View 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
View 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>'