Thanks for your answer. But I don't want to change db config or ALTER DATABASE data SET bytea_output='escape'; I can change my app. So is there document introduce how to work with postgresql 9 bytea ( I don't want to user lo_create, lo_import. lo_export)