package com.leevilehtonen.cookagram.config;

import org.hibernate.dialect.PostgreSQL94Dialect;
import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;

import java.sql.Types;

public class PostgreSQLDialectCustom extends PostgreSQL94Dialect {

    @Override
    public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
        if (sqlTypeDescriptor.getSqlType() == Types.BLOB) {
            return BinaryTypeDescriptor.INSTANCE;
        }
        return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
    }
}

package com.leevilehtonen.cookagram.config;

import org.hibernate.dialect.PostgreSQL94Dialect;

import java.sql.Types;

public class PostgreSQLDialectCustom extends PostgreSQL94Dialect {

    public PostgreSQLDialectCustom() {
        registerColumnType(Types.BLOB, "bytea");
        registerColumnType(Types.LONGVARBINARY, "bytea");
    }
    
}

Update image content type for Postgres
Update image content type for Postgres
