-
Notifications
You must be signed in to change notification settings - Fork 216
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
Converting quotes properly to double quotes in Postgres in custom field name scenario #4878
Comments
Thanks for the issue. Currently PRQL evaluates that ident as not requiring quotes — are they required? |
Thanks for the quick reply. In most of the cases they are not required. The scenario I am working on is if a user entered text of the field name is a reserved word by Postgres. In that case I add quotes and expect them to be double quotes as otherwise SQL fails. A good example is if we replace |
There does indeed seem to be a problem here: from x
derive y = user ...doesn't quote SELECT
*,
user AS y
FROM
x
-- Generated by PRQL compiler version:0.13.0 (https://prql-lang.org) ...despite prql/prqlc/prqlc/src/sql/keywords.rs Line 23 in a0f12b4
I'll have a look later, thanks for the issue |
Hey @max-sixty is there any update on this issue? |
Sorry for the delay, I will actually take a look at this, latest this weekend. Hold me accountable if you don't hear anything :) Edit: didn't get to it this weekend but haven't dropped it... |
What happened?
When using quotes in field names, it should properly convert them to double quotes, but PRQL just removes them.
Note the quoted
sum_income
part that converts to sum_income without any quotes.PRQL input
SQL output
Expected SQL output
MVCE confirmation
Anything else?
No response
The text was updated successfully, but these errors were encountered: