Daniel Carlsson wrote:
> When a fetch binary data from a bytea column the data gets messed up.
>
> Se the attached code, postgresql returns 13744 bytes when it should
> be only 10000. After studing the output I saw that bytes representing
> common characters are fetched ok but bytes representing unusual
> characters such as special swedish characters are messed up. Is the
> binary data somewhere treated as character data?
Yes, for output all "non-printable" characters are octal escaped. See:
http://www.us.postgresql.org/postgresql-7.3.3/datatype-binary.html
Joe