rapidloop / pgmetrics

Collect and display information and stats from a running PostgreSQL server
https://pgmetrics.io
Apache License 2.0
960 stars 65 forks source link

get all database details without specifying dbnames? #31

Closed minusf closed 4 years ago

minusf commented 4 years ago

is there a way to get the detailed, per database report for the whole cluster without the need to specify a list of dbnames?

mdevan commented 4 years ago

Not directly, but you can get the list of database names with a separate psql command first:

DBNAMES=$(psql -Xqtc 'select datname from pg_database where not datistemplate')
pgmetrics -w -o report.txt $DBNAMES
minusf commented 4 years ago

yeah i was hoping to do something without more scripting, pgmetrics already loops through all db's without the details after all... but you can close it if you want, thanks.