Diogo Biazus <diogo(at)ikono(dot)com(dot)br> writes:
> Am I doing something wrong?
You forgot to set up the length word that's required for a bytea value
(or any other variable-length datatype). The system is taking the first
four bytes of the file data as the datum length.
regards, tom lane