psqlでselect結果をタブ区切りで出力ぢゃ。

psql -dデータベース名 -F $'\t' -t -A -c"select * from xxxxx" > xxxxx.txt

リダイレクトを使ってファイルに書き出すと便利ですな。