GP - To gather GUC that is currently being set in the database

Generating the report on the parameter values of the cluster
SELECT 
 name AS "Parameter Name",
 substr(setting, 1, 30) AS "Parameter Value",
 substr(short_desc, 1, 100) AS "Parameter Desc"
FROM pg_settings
ORDER BY 1;

Add-On Script;

for DBname in `psql -d postgres -Atc "SELECT datname from pg_database WHERE datname NOT IN ('template0','template1','postgres')"`
do
echo -e "Listing Down GUC from $DBname" >> /tmp/GUC_List.log
psql -d $DBname -c "
SELECT 
 name AS \"Parameter Name\",
 substr(setting, 1, 30) AS \"Parameter Value\",
 substr(short_desc, 1, 100) AS \"Parameter Desc\"
FROM pg_settings
ORDER BY 1;" >> /tmp/GUC_List.log
done
NOTE: Above script will help in looping all database(s) to fetch GUC and will be reported in /tmp/GUC_List.log

Comments

Popular posts from this blog

GP - Kerberos errors and resolutions

How to set Optimizer at database level in greenplum

GP - SQL Joins