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

Fix Insert/Update/Delete CTEs #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wrmsr
Copy link

@wrmsr wrmsr commented Nov 18, 2016

So this patch fixes the fact that redshift wants cte's on inserts after the insert (which seems to conflict with the pg grammar but whatever amzn). This effectively fixes the behavior noted here. Notably this changed in sa 1.1.0 from the cte's simply being absent (as is the case in the version depped by this lib) to them being in the wrong position (as in the latest version of sa for which I originally authored this patch). In both cases however this patch appears to function correctly.

Todos

  • MIT compatible
  • Tests (if a little lame lols)
  • Documentation
  • Updated CHANGES.rst

@@ -56,3 +56,6 @@ docs/_build/

# PyBuilder
target/

# IntelliJ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

@khomenko
Copy link

@wrmsr are you looking to finish this PR at some point? Just ran into the same nasty issue.

@mwlebour
Copy link

I too just ran into this issue. I filed a new issue as there now seems to be a flag in the base Dialect class that toggles the insert/cte order, see issue #154 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants