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

Syntax error: 7 ERROR: syntax error at or near "group" using postgresql #61

Closed
tuseto opened this issue Oct 9, 2024 · 3 comments · Fixed by #63
Closed

Syntax error: 7 ERROR: syntax error at or near "group" using postgresql #61

tuseto opened this issue Oct 9, 2024 · 3 comments · Fixed by #63
Assignees

Comments

@tuseto
Copy link

tuseto commented Oct 9, 2024

When search into the search input it throws an exception:
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "group" LINE 1: ...) as aggregate from "language_lines" where (lower(group::tex..

The database is postgresql so because there is no (JSON_ARRAY()) as in the docs
I've used just ->default(json_encode([]))

"name": "kenepa/translation-manager",
"version": "4.0.11",

"name": "laravel/framework",
"version": "v11.26.0",

Shared error: https://flareapp.io/share/dPbERpAm

@Jehizkia
Copy link
Member

Hi thanks for reporting,

I'm not familar with this issue. But could you maybe try to use json_build_array() which is supported by postgresql according to: https://www.postgresql.org/docs/9.4/functions-json.html.

@tuseto
Copy link
Author

tuseto commented Oct 11, 2024

@Jehizkia same.

I am wondering can the issue be with that group is a keyword in postgresql?
I am not aware of how this query exactly is built because laravel query builder should take care of such problem

@Jehizkia
Copy link
Member

Ah yes, you are correct. I managed to kind of replicate the issue outside of the project by running a similar query. I'll dive deeper into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants