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
Support for Redshift statements which cannot be run inside a transaction #1879
Comments
CREATE EXTERNAL TABLE
which cannot be run inside a transaction
Affected statements:
The current implementation (derived from the PostgreSQL one) also incorrectly looks for
These checks should be removed. |
This has now been fixed. For
|
Thanks! |
Redshift also cannot execute an alter table on an external table inside a transaction. It appears this scenario was not covered by this fix. Was this just missed, or was there a specific reason this could be made to work? |
@simonejsing This was most likely missed as it isn't documented anywhere in the Redshift docs. The same workaround as in #1879 (comment) applies. We'll update our docs to reflect this. |
Thanks, but it is a bit of a clunky work-around since I can't actually vacuum the external table I'm altering. It will have to be a vacuum on some other physical table that is unrelated to the migration... |
…n inside a transaction
I found that flyway cannot create an external table because it does not recognise it must be run in a transaction. I have forked flyway and believe I have made the necessary addition here gareth625@f6b404d. My Java isn't good enough to find and add a unit tests but I have built the JAR and tested against a Redshift cluster.
Unfortunately I haven't tested the migrations I have included as I'm having trouble accessing my company's AWS resources externally. I wanted to get the ball rolling though and the changes into a commitable state.
What version of Flyway are you using?
4.2.1
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Command line
What database are you using (type & version)?
Redshift
What operating system are you using?
Linux
What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
Ran a migration to create an external schema on a Redshift cluster using Athena catalogue which succeeds:
then tried to create an external table in the schema, for example:
which fails as you cannot create an external table in a transaction.
This I did using two migrations with the flyway command line tool.
What did you expect to see?
Creation of the external schema and table.
What did you see instead?
The creation of the external schema but not the table.
The text was updated successfully, but these errors were encountered: