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

org.postgresql.util.PSQLException: ERROR: operator does not exist: status_enum = character varying exception after migrating Spring 3 with Hibernate 6.3.1 #660

Closed
JotDakha opened this issue Oct 5, 2023 · 1 comment

Comments

@JotDakha
Copy link

JotDakha commented Oct 5, 2023

@vladmihalcea Earlier I was using hibernate-types-52 library to support for PostgreSQLEnumType with Hibernate @typedefs. But after migration, hypersistence-utils-hibernate has been updated to support Postgres custom enum datatypes.

(looking for a solution and by referring to this ticket:- #514)
@Enumerated(EnumType.STRING)
@column(columnDefinition = "status_enum")
@type(PostgreSQLEnumType.class)
private Status status

exception getting - Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: status_enum = character varying_
And if I am lowering the hibernate version to 6.2.9, then getting the exception.

Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [status] in table [user]; found ["status_enum" (Types#VARCHAR)], but expecting [status_enum (Types#OTHER)]

Attaching ticket opened with hibernate team - https://discourse.hibernate.org/t/cannot-invoke-org-hibernate-boot-spi-metadatabuildingcontext-getmetadatacollector-because-this-metadatabuildingcontext-is-null/8298

Please suggest to resolve this issue or let me know if I missed any steps.

@vladmihalcea
Copy link
Owner

vladmihalcea commented Oct 5, 2023

Hibernate 6.3 support should be implemented via #657.

If you need this feature, then you should definitely send me a Pull Request with the fix for that issue. I won't have the time to implement it myself, but I could review it for you when you are done.

By the way, after looking at the Hibernate forum discussion you mentioned, it looks like you are using an ancient version of the library.

Try migrating to Hypersistence Utils instead of the old Hibernate Types dependency and give it a try with Hibernate 6.2.

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

No branches or pull requests

2 participants