Native query of postgres to extract based on pattern works fine.

select to_number(substring('12.123','^\d+'),'FM9G999D99S')

Same used to work as JPA query (not as native query) in Spring boot 2.7 but not working with Spring boot 3.

Spring boot 2.7 dialect used: org.hibernate.dialect.PostgreSQL10Dialect

Spring boot 3 dialect used: org.hibernate.dialect.PostgreSQLDialect

Getting below error.

org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.QueryException: Parameter 2 of function substr() has type INTEGER, but argument is of type java.lang.String

Comment From: wilkinsona

I suspect that this is due to the upgrade to Hibernate 6.1. As such, it is out of Spring Boot's control. If you believe the problem is specific to how Spring Boot has configured Hibernate, please provide a minimal sample that reproduces the problem and we can investigate.