Quantcast
Channel: Robin on Linux
Viewing all articles
Browse latest Browse all 236

Use `psql` to download data as CSV file

$
0
0

Although SQL WorkBench is a handy tool for querying AWS Redshift, we still need to CLI tool for automation.
To install psql on MacOS, we need to

brew install postgresql

Then we could download data without using \copy but only –csv

echo "select * from example" | psql -h my.endpoint.com -p 5439 --csv mydatabase myuser > output.csv


Viewing all articles
Browse latest Browse all 236

Trending Articles