Skip to content
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

CASE statements don't include the CASE and END keywords #575

Open
young-mmfm opened this issue Mar 10, 2023 · 0 comments
Open

CASE statements don't include the CASE and END keywords #575

young-mmfm opened this issue Mar 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@young-mmfm
Copy link

young-mmfm commented Mar 10, 2023

Mammoth seems to omit the CASE and END keywords:

"text": "SELECT foo.id, (WHEN foo.value > $1 THEN $2 ELSE $3) greatness FROM foo",

When I run the query

"SELECT foo.id, (WHEN foo.value > $1 THEN $2 ELSE $3) greatness FROM foo"

Postgres returns:

ERROR:  syntax error at or near "WHEN"

When I run the query

"SELECT foo.id, (CASE WHEN foo.value > $1 THEN $2 ELSE $3 END) greatness FROM foo"

Postgres runs the query correctly.

@young-mmfm young-mmfm added the bug Something isn't working label Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant