How to import a PostgreSQL data file into Amazon redshift -


i trying import postgresql data file amazon redshift using command line. did import schema file can not import data file. seems data insertion in amazon redshift bit different.

i want know kinds of way of importing data file redshift using command line.

update

my data file looks :

copy actor (actor_id, first_name, last_name, last_update) stdin;  0 chad murazik 2014-12-03 10:54:44 1 nelle sauer 2014-12-03 10:54:44 2 damien ritchie 2014-12-03 10:54:44 3 casimer wiza 2014-12-03 10:54:44 4 dana crist 2014-12-03 10:54:44 .... 

i typed following command cli:

pgpassword=**** psql -h testredshift.cudmvpnjzyyy.us-west-2.redshift.amazonaws.com -p 5439 -u abcd -d pagila -f /home/jamy/desktop/pag_data.sql` 

and got error :

error: load source not supported. (hint: s3 or dynamodb or emr based load allowed

dump table using csv format:

\copy <your_table_name> 'dump_fulename.csv' csv header null '\n' 

upload s3, , read redshift using:

copy schema.table 's3:/...' credentials '...' csv; 

source: importing data redshift mysql , postgres


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -