Kien Pham
Kien Pham

Reputation: 41

How to insert time into redshift

Redshift only support TIMESTAMP format, I want to dump some data that is originally stored in Postgres in time without time zone format. My data looks like this: 15:30:00

When I COPY my data into Redshift, it says Invalid timestamp format or value [YYYY-MM-DD HH24:MI:SS], error code 1206.

My current workaround is to create that column in Redshift as CHAR(8)

Thanks

Upvotes: 1

Views: 1342

Answers (2)

vtuhtan
vtuhtan

Reputation: 1066

Redshift does not support timezones.

Workaround would be to parse data to UTC and store time difference in separate column. You will be able to calculate local time by adding/substracting hours to the UTC data.

Upvotes: 1

mike_pdb
mike_pdb

Reputation: 2828

There's no other solution that to use the char(8).

Upvotes: 1

Related Questions