I have a spring application that uses MySQL as database.
I want to migrate the application from MySQL to Postgres, and it seems that I can not declare byte[] array:
I have this column:
@Type(type="org.hibernate.type.BinaryType")
private byte[] data.
I get this error:
Caused by: org.postgresql.util.PSQLException: ERROR: type "tinyblob" does not exist
Is there a way to achive this in PostgreSQL?
In your PostgreSQL DB Table, set the data column datatype to bytea NOT bytea[]
and in your POJO class:
@Column(name="name_of_your_column")
private byte[] data;
Leave out the @Type(type="org.hibernate.type.BinaryType") annotation.
That should work just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With