-
Notifications
You must be signed in to change notification settings - Fork 39
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
Rel8 produces invalid SQL: ERROR: argument of CASE/WHEN must not return a set
#219
Comments
ilyakooo0
changed the title
Rel8 produces invalid SQL
Rel8 produces invalid SQL: Dec 9, 2022
ERROR: argument of CASE/WHEN must not return a set
ERROR: argument of CASE/WHEN must not return a set
ilyakooo0
changed the title
Rel8 produces invalid SQL:
Rel8 produces invalid SQL: Dec 9, 2022
ERROR: argument of CASE/WHEN must not return a set
ERROR: argument of CASE/WHEN must not return a set
ilyakooo0
changed the title
Rel8 produces invalid SQL:
Rel8 produces invalid SQLDec 9, 2022
ERROR: argument of CASE/WHEN must not return a set
ERROR: argument of CASE/WHEN must not return a set
ilyakooo0
changed the title
Rel8 produces invalid SQL
Rel8 produces invalid SQL Dec 9, 2022
ERROR: argument of CASE/WHEN must not return a set
ERROR: argument of CASE/WHEN must not return a set
ilyakooo0
changed the title
Rel8 produces invalid SQL
Rel8 produces invalid SQL: Dec 9, 2022
ERROR: argument of CASE/WHEN must not return a set
ERROR: argument of CASE/WHEN must not return a set
shane-circuithub
added a commit
that referenced
this issue
Jun 17, 2023
Thanks so much for reporting this @ilyakooo0, you're right that it is an error. I've added a fix in #240 for what it's worth. I'm sorry it took so long to get to this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is my understanding that the goal of rel8 is to produce valid SQL in a type-safe manner. Meaning, if the Haskell code compiles without errors and does not use any constructs explicitly marked as "unsafe" in the library, then the produces SQL should always be valid (assuming the declared tables in code match the actual database schema).
I think I found a case where the produces SQL produces an error in Postgres before it is even checked against the schema.
I wrote this script which reproduces the issue:
The script produces the following schema-independent SQL query:
When I try to execute the query I get the following error:
I think this indicates that there is a bug somewhere in rel8.
The text was updated successfully, but these errors were encountered: