I have taken the daily dump file and unzipped it and then placed it back up onto s3.

When I try and do a copy statement in postgresql I am receiving the following error

Missing newline: Unexpected character  0x14 found at location 4

Query:

copy temp from 's3://bucket/top-1m.csv' credentials 'blah blah blah';

Do I have to add some kinda character to each line?

Raw Data:

1,facebook.com
2,google.com
3,youtube.com
4,yahoo.com
5,amazon.com
6,baidu.com
7,wikipedia.org
8,live.com
有帮助吗?

解决方案

The Redshift COPY command uses PIPE '|' as the default delimiter character. If your files are delimited by another character (comma in your case), all you need to do is add the DELIMITER keyword to your COPY command.

copy temp from 's3://bucket/top-1m.csv' credentials 'blah blah blah' delimiter as ',';

or for comma separated files:

copy temp from 's3://bucket/top-1m.csv' credentials 'blah blah blah' csv;

其他提示

copy temp from 's3://bucket/top-1m.csv' credentials 'blah blah blah' delimiter ',';

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top