-
Notifications
You must be signed in to change notification settings - Fork 65
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
csvq complains about ambiguous column name in LATERAL JOIN query. #30
Comments
Yes, I’m aware of the difference in behavior between csvq and postgresql. Regardless of what the specification allows, I think that table name modifiers should be used when specifying column names, and there are many minor differences between csvq and standard sql or other DBMS. |
Wait, I may now have found an easy way to implement it. If it's feasible, I'll do it later. |
I agree with you that it is a good practise to specify table name modifiers explicitly in order to avoid column name ambiguity. I presume the SQL standard allows queries to omit table name modifiers on ambiguous column name references for the benefit of query concision. |
Fixed the scope in LATERAL subquery and released in version 1.13.1. |
|
Great work! |
As I stated very briefly at the start of my
LATERAL JOIN
test, my test slightly modified the example queries in PostgreSQL’s LATERAL JOIN. Here, I repeat my test using the original and unaltered queries:In both cases,
csvq
complains that the non-scoped or unaliased reference touser_id
in the second or lateral subquery in theFROM
clause is ambiguous. Assuming, possibly incorrectly, that the PostgreSQL SQL interpreter follows the SQL standard and thecsvq
error is incorrect, in the presence of the same column reference in multiple adjacent subqueries in the sameFROM
clause, when resolving the non-scoped reference touser_id
in the second subquery,csvq
should choose the instance from within the immediate enclosing scope.The text was updated successfully, but these errors were encountered: