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

Create views inside an atomic transaction #45

Merged
merged 2 commits into from
Mar 5, 2019
Merged

Create views inside an atomic transaction #45

merged 2 commits into from
Mar 5, 2019

Conversation

caioariede
Copy link
Contributor

With this change we ensure DROP ... CREATE happens inside an atomic transaction, and if any issues happens during the CREATE process, the "old" view is still accessible.

Also, within the transaction, we understand that the view is accessible even during its creation, being replaced only when the new one is available (after commit).

@caioariede
Copy link
Contributor Author

@tpict hey, thanks for maintaining this amazing package! It is been very helpful for us. Do you mind taking a look on this PR when you get a chance? :)

@tpict
Copy link
Contributor

tpict commented Mar 1, 2019

hi! thanks for the PR, this seems like a sensible addition 😄 I'll take a closer look and get back to you in the next 2-3 days (sorry, super busy at the moment)

@caioariede
Copy link
Contributor Author

@tpict awesome! One of the tests I did locally, was to add %x to Postgres log_line_prefix and see through the logs the transaction for each statement.

Let me know if you need anything from me.

@tpict
Copy link
Contributor

tpict commented Mar 5, 2019

hi @caioariede, sorry about the delay! merging this in, thanks for the PR 👍

@tpict tpict merged commit 336f692 into mypebble:master Mar 5, 2019
@caioariede caioariede deleted the fix/create_view_inside_transaction branch March 5, 2019 13:53
@caioariede
Copy link
Contributor Author

@tpict thank you!

Do you think this PR is worth it a new version on PyPI? The great benefit of having views being created inside an atomic transaction is that the "old" view is still accessible during recreation.

Releasing this to PyPI would be a tremendous benefit for us to remove workarounds for our codebase, but it totally up to you :)

@tpict
Copy link
Contributor

tpict commented Mar 7, 2019

i'll release a new version this evening since you asked nicely 😉

@caioariede
Copy link
Contributor Author

Awesome! Thanks :)

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.

2 participants