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

bad rewriting of query involving targetList indirection: "UPDATE SET (col2, col1, col3)" #7674

Open
c2main opened this issue Aug 23, 2024 · 2 comments

Comments

@c2main
Copy link
Contributor

c2main commented Aug 23, 2024

A customer reported a bug from development team affecting queries with UPDATE SET (col2, col1, col3) = (.....)
The columns are reordered following their physical ordering in pg_attribute, leading to for example UPDATE SET (col1, col2, col3) = (.....) with the right part, after = unchanged, as a results wrong columns are updated...

I have a complete test case, and a PR which I'm going to link in a moment. I think the issue may affect silently many applications, even more because the behavior can change over time based on the DDL applied on the updated tables.

There are several issue, I'm going to collect what I fond and link here so maybe we can close several at once...

Please see https://github.com/citusdata/citus/actions/runs/10527721147#summary-29171656391 for some examples of the problem.

@c2main
Copy link
Contributor Author

c2main commented Aug 23, 2024

Similar to #4092 which focus on reference table.

@c2main
Copy link
Contributor Author

c2main commented Aug 23, 2024

Yes I will update with patch for pg14 and pg15.

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

No branches or pull requests

1 participant