I found the solution, i created a SessionBean and put all PostgreSQL specific code there to store the file.
SQL in SessionBean is spagethi code (or at least anti-pattern). Use Entity Bean for it.
Mapping for PostgreSQL is:
Did you try such field in entity?
(I use String and TEXT for very long texts and works perfectly)