-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL] DML Table-Join Support: USING clause in delete and FROM clause in update #738
Comments
I see that UPDATE FROM is documented for 1.2, but when I attempt to use it, I get a cryptic message:
|
Thanks @ajcaldera1 , it's a documentation error. I'll update the doc. |
Is there any progress on this? |
jaki
pushed a commit
that referenced
this issue
Aug 3, 2020
… (#5262) This pull request enables USING clause in DELETE and FROM clause in UPDATE in gram.y for queries like: DELETE FROM a_table USING another_table WHERE a_table.id = another_table.id; UPDATE a_table SET col = xxx FROM another_table WHERE a_table.id = another_table.id; Tests for such queries are present in TestPgUpdate.java and TestPgDelete.java. This effectively closes Issue #738. This pull request was originally part of the larger pull request #5190 (now edited) which has now been broken down into 4 separate pull requests: #5190 (edited), #5262, #5263, #5264.
Close by commit 09d0f9c. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
USING in delete and FROM in update are for listing the tables that are to be accessed by WHERE clause. These clauses should be supported to allow join in the DML statements.
Examples:
DELETE FROM a_table USING another_table WHERE a_table.id = another_table.id;
UPDATE a_table SET col = xxx FROM another_table WHERE a_table.id = another_table.id;
The text was updated successfully, but these errors were encountered: