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
[postgres] Complaining about missing alias in CTE #3558
Comments
We merged a PR a couple days ago which may have fixed this. |
This is not a bug. L013 is working as designed: It wants computed columns to have aliases. Why do you think this is a bug? |
It could be argued the computer columns have aliases here (a, b, c). |
Then again it could also be argued a more explicit alias within the select query itself would be more useful (e.g. it could be used in order by or group by queries). |
That's true -- a different form of alias. I'm inclined to call this an enhancement rather than a bug. |
In cases where the CTE has a column list, we don't need an alias for columns. This checks if the select has a `common_table_expression` parent and if that parent has a `cte_column_list` child. In that case, it doesn't complain about a missing alias. Fixes sqlfluff#3558
In cases where the CTE has a column list, we don't need an alias for columns. This checks if the select has a `common_table_expression` parent and if that parent has a `cte_column_list` child. In that case, it doesn't complain about a missing alias. Fixes sqlfluff#3558
In cases where the CTE has a column list, we don't need an alias for columns. This checks if the select has a `common_table_expression` parent and if that parent has a `cte_column_list` child. In that case, it doesn't complain about a missing alias. Fixes sqlfluff#3558
In cases where the CTE has a column list, we don't need an alias for columns. This checks if the select has a `common_table_expression` parent and if that parent has a `cte_column_list` child. In that case, it doesn't complain about a missing alias. Fixes #3558
Search before asking
What Happened
Linting errors raised where no errors are expected
Expected Behaviour
No errors.
Observed Behaviour
While also (still) raising issue #3474, it also complains about the missing alias as soon as one uses a non-column/non-constant expression.
How to reproduce
Use the following
2022-07-05.cte-column-alias.sql
file:Dialect
postgres
Version
Configuration
defaults
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
The text was updated successfully, but these errors were encountered: