LoginSignup
2
2

More than 5 years have passed since last update.

DockerのPostgreSQLからCSVファイルを出力する

Last updated at Posted at 2018-03-22
  • Dockerのexecコマンドでできる
  • psqlのpagerをoffにしないとmoreが起動してしまう
  • 末尾に (196 rows) みたいなのが出る

以上の問題を解決した結果。

docker exec -it my-db-name psql -P pager=off -U postgres -d n_coin -c "select * from users order by \"userId\";" -A -F, | sed '$d' > users.csv

こんな感じ。

健忘録として。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2