Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redshift COPY not working #983

Closed
cajnoj opened this issue Apr 6, 2015 · 3 comments
Closed

Redshift COPY not working #983

cajnoj opened this issue Apr 6, 2015 · 3 comments

Comments

@cajnoj
Copy link

@cajnoj cajnoj commented Apr 6, 2015

Migration fails during a COPY statement. In Redshift, COPY has a CREDENTIALS clause for Amazon S3 credentials. I think that the problem is that a semicolon separates between the AWS access-key and the AWS secret access-key inside the credentials string. Tried escaping the semicolon but it didn't help.

Error text:
Migration V__.sql failed
SQL State : 42601
Error Code : 0
Message : ERROR: unterminated quoted string at or near "'aws_access_key_id=...

@cajnoj
Copy link
Author

@cajnoj cajnoj commented Apr 6, 2015

Found the reason.
flyway gives special treatment to the COPY statement in order to support COPY FROM STDIN - a feature that isn't available in Redshift.

I can fix this.

@cajnoj cajnoj changed the title Redshift COPY & UNLOAD statements Redshift COPY not working Apr 6, 2015
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Apr 8, 2015

Thanks for investigating. Can you post an example statement that fails?

@cajnoj
Copy link
Author

@cajnoj cajnoj commented Apr 8, 2015

Take as an example:

COPY schemaname.tablename FROM 's3://bucketname/filepath' CREDENTIALS 'aws_access_key_id=ZZZZZ;aws_secret_access_key=bbbbb' GZIP;

@axelfontaine axelfontaine added this to the Flyway 4.0 milestone Oct 28, 2015
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants