-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
postgresql : UPDATE query formed incorrectly, update ... set ... FROM ... where #7055
Comments
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
I have the same issue (with gorm.io/driver/postgres v1.5.7& gorm.io/gorm v1.25.10). It's based on: |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
@alkuma I added a playground test case for this here, I'm facing the same issue: go-gorm/playground#746 |
FWIW it looks like this is a regression that started in gorm.io/driver/postgres v1.5.3 (v1.5.2 does not have this issue) |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
@ajhodges go-gorm/playground#746 is a much more concise test case than mine. Let me add this to the original issue report thank you |
Just got bit by this issue as well, it's even more apparent when using soft deletion "updates". |
use |
@a631807682 I updated the example here with a session: go-gorm/playground#746 It has no effect. I still get this error:
Again, this seems to be a regression in gorm.io/driver/postgres v1.5.3+ |
GORM Playground Link
go-gorm/playground#746 provided by @ajhodges
Description
I have an update executed within a database transaction and that is leading to the following faulty query
The error obtained from postgres is
I have another location where this query works fine, the only difference I see is that at SELECT has been performed on the same table before this update.
Is this a case of the stale FROM clause from the SELECT lying in the parse tree when the UPDATE is query is being formed? If so what is a workaround for this?
this is using
Here is a sequence of queries that ran before getting to this faulty update query. The sequence is edited by hand for brevity
Are there any changes that happened which could lead to the previous SELECT query's parse tree is still lying around and polluting the parser input for the update?
If so is there a workaround for this?
The text was updated successfully, but these errors were encountered: