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

[8.x] Re-add update from support for PostgreSQL #39151

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Oct 8, 2021

This PR re-introduces "update ... from ..." support for the PostgreSQL grammar. Since there wasn't a good option or straight way to re-implement the behavior after the refactor in #29393 I opted to add a new dedicated updateFrom method specifically for the PostgreSQL grammar.

This implementation is a bit cumbersome and crude as people will need to specifically use updateFrom instead of update if they want the correct behavior. Ideally this would be done automatically.

I've tested this with the queries from #33265 and got them back working with this. I also re-added the original tests that were removed.

Before merging this I'd like to:

If we get feedback from someone who can think of a better way to solve this then gladly. Otherwise I think this is the only solution for the problem at hand.

Fixes #33265

@mikerockett
Copy link

Thanks for this! I wonder if updateWith might be better suited?

updateFrom works though, and another option I'd thought of, updateUsing, would also make sense, but I thing the "using" terminology is better for callables.

@driesvints
Copy link
Member Author

@mikerockett I personally think updateFrom is probably the most straightforward name since that indicates the fix its making.

One other thing that might be considered is changing the API of the method slightly so the name makes more sense or its usage is more straightforward.

@driesvints
Copy link
Member Author

Since no one from the related issue has replied to far I'm submitting this as-is.

@driesvints driesvints marked this pull request as ready for review October 12, 2021 07:27
@hyde1
Copy link

hyde1 commented Oct 13, 2021

Hi @driesvints!
Thanks for working on this issue. I just gave a try and it works perfectly for me and my use case.

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.

Postgresql update: removed support for "update ... from ..." statement in 6.x and 7.x
4 participants