How to import/export data from Amazon Redshift

Amazon Redshift is fully managed Date Warehouse solution from Amazon. Many times we need to export/import data into it using CSV for testing or for data migration. Let’s see how to import/export data from Amazon Redshift.

This post assumes Postgres Amazon Redshift

Import/Expot Data

Setting password

There are other ways of managing password, but my preferred way while using a terminal is to export it for the session. Here is how to do it

Export Data from Amazon Redshift

Where
p – port where Redshift is listening
U – User name
d – Database name
mytable – Name of table

Importing Data into Amazon Redshift

This shall import data into mytable from mytable.csv

Leave a Reply

Your email address will not be published. Required fields are marked *