Email::Store::Attachment - my losing battle

Jonathan Stowe jns at
Wed Nov 29 17:08:41 GMT 2006

On Wed, 2006-11-29 at 16:38 +0000, Chisel Wright wrote:
> On Wed, Nov 29, 2006 at 11:12:42AM -0500, jesse wrote:
> > My pre-coffee guess is that it's not binding the column as a blob type
> > before doing the insert.  Postgres and DBD::Pg blob support used to suck
> > rocks. (RT needed to Base64 binary attachments), but things have
> > improved markedly in the past couple of years.
> I knew MattL couldn't resist. I've got a bytea column for the payload
> now, and a hacked Email::Store::Attachment that now has:
>   my $payload = $_->bodyhandle->as_string;
>   $payload =~ s/([\x00-\x1f'\\\x7f-\xff])/'\\\\' . sprintf("%03o", ord($1))/eg;
> which does get successfully inserted.

Yeah. If you read the Postgres documentation about the bytea data type
you will see that it does indeed say that certain non-printable
characters need to be escaped like that.  The same applies to other
database systems.


More information about the mailing list