-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PostgreSql: operator does not exist: timestamp without time zone >= bytea #2491
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
Comments
I tried one thing. And if pass Is there any workarounds? I want search all rows without timestamp filter or with timestamp filter. |
What happens if you use If this is native SQL via |
I tried Error gone when I pass objects of Instant class instead of null. |
@gregturn is correct about Your statement seems to be missing a
Could you confirm, that this works? |
I have next query:
And it transforms to this query:
And I got an error, because in I Used |
I created query without I passed Query Log:
|
What happens if you remove some of those redundant parentheses? I don't think you need them around
|
Query:
When |
I am having the same issue. |
@Tsyklop Frankly, I feel as if you should check in advance whether either :createdAtFrom or :createdAtTo is |
@gregturn Already did this. |
I don't think this is a Hibernate is slow to respond to bugs for specific drivers, so I can't guarantee that this will solve it. So I recently added an improvement to solve this in As far as I know this was released after 2.7.x, so please try the later version. |
Another story, but we've heard reports of side effects from this, so we'll need to check this out. 🤔 See #2461 (comment) |
After a 6 hours of useless brain suffering i manage to do this (just example):
|
Well, I've discovered that Hibernate is prone to not route null values through attribute converters, so that may the issue you're also running into. If this is also suffering from a PostgreSQL/Hibernate incompatibility, then there may be little here for Spring Data JPA to do. |
Hitting same issue with Spring Boot 2.6.6, Hibernate 5.6.7, JDBC driver 42.2.25, and Postgres 13.1. Work-around from @akakyi didn't work for me. Suspect @gregturn is right this isn't a Spring Data JPA issue per se it's more a Hibernate + Postgres issue that a bunch of us happen to be stumbling into via Spring Data JPA and native For now I'll be working around this by forbidding |
This works for me. Thanks life savior |
Maybe this information https://blog.mimacom.com/java-8-dates-with-postgresql/ would be useful for solving your problem. As for me supposed solution works well. |
i am having the same issue. SQL Error [42883]: ERROR: operator does not exist: timestamp without time zone >= integer |
select oc.id_ocorrencia,cli.nome as nomeCliente, |
Since we've seen multiple people implement a mechanism to work between Postgres and Hibernate, this is not really a Spring Data JPA issue. Spring Data JPA is somewhat limited in what it do to help when it comes to native queries. And so I recommend crafting a custom implementation. Check out https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.custom-implementations for more details on how to hook such a solution into your repository (if you haven't already figured that out). |
can't believe it works! thanks |
I understand this might not be an issue anymore, but addressing it could save some time. In my case: Java (with Joda-Time), Hibernate, and PostgreSQL. To resolve it, simply use the solution provided in your entity class as described here: Joda-Time Hibernate User Guide. Source code: GitHub - Joda-Time Hibernate |
Use Spring Boot 2.6.6, Spring data JPA, Hibernate 5.6.7.Final, PostgreSql Driver 42.3.3, PostgreSql Server 14.
I have query:
SELECT u.* FROM "user" u WHERE ((:createdAtFrom = NULL OR :createdAtTo = NULL) OR (u.birthday BETWEEN :createdAtFrom AND :createdAtTo))
Native.But it not working.
I got error:
I turned on hibernate debug for sql parameters and see next rows:
Why
VARBINARY
?I tried
java.util.Date
,java.time.LocalDateTime
- same error. what wrong?There is demo repo: https://gitlab.com/Tsyklop/jpa-test/-/tree/master
Stackoverflow: https://stackoverflow.com/questions/71902768/spring-boot-2-postgresql-operator-does-not-exist-timestamp-without-time-zone
The text was updated successfully, but these errors were encountered: