postgresql でクエリのログをとる

postgresql.conf に以下の設定を追加

log_statement = true
log_duration = true

これで すべてのクエリがログファイルに保存される.