I have a project with Java 11 + Spring Boot 2 + Liquibase + Postgres 11. There is a task to make SQL dump of table from a legacy Oracle DB and craft a migration from it. Table has a BYTEA columnt with small GIF images (~400 bytes, tiny icons). Migration should be applied successfuly not only to Postgres, but to H2 in test as well. But there is an issue, that H2 and Postgress, seemingly, have a different syntax for HEX literals, when inserting into a BYTEA column. As far as I googled, H2 requires X'0123456789ABCDEF' and Postgres requires '\x0123456789ABCDEF'. When I try to apply the migration to H2 with Postgres HEX syntax, an exception "Hexadecimal string contains non-hexadecimal characters" is thrown. Are there any workarounds or proper way to do such a thing?
decode(filedata-in-hex, 'hex')function.--changeset author:id dbms:h2and--changeset author:id dbms:postgresql. Very convinient attribute.