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

error when select from postgresql() where 1=1 and (id=id) #52654

Closed
dmitriy-myz opened this issue Jul 27, 2023 · 1 comment · Fixed by #56456
Closed

error when select from postgresql() where 1=1 and (id=id) #52654

dmitriy-myz opened this issue Jul 27, 2023 · 1 comment · Fixed by #56456

Comments

@dmitriy-myz
Copy link
Contributor

CH 22.8.12.45

When trying to query postgresql function with condition WHERE 1=1 and (id=id) (generated query) ch generates query with wrong syntax for postgres.

Any query to postgres:

select * from postgresql(...)
where 1=1 and id=id 

Code: 1001. DB::Exception: Received from localhost:9000. DB::Exception: pqxx::sql_error: ERROR: argument of AND must be type boolean, not type integer
LINE 1: ...column" FROM "table" WHERE 1 AND ("id...

It's same issue as #33152 but when condition (which ch can not optimize) added provided fix is not working

@Algunenano
Copy link
Member

Should be fixed by #56456

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

Successfully merging a pull request may close this issue.

2 participants