Hello,
From: Paul J Stevens <[EMAIL PROTECTED]>
Subject: Re: [Dbmail-dev] mail content-type and database encoding
Date: Fri, 11 Nov 2005 11:37:26 +0100
Message-ID: <[EMAIL PROTECTED]>
> >> Ryo's patch earlier this year seemed more complex<ahem> comprehensive.
> >>
> >> Let me try working with Ryo's patch....
> >>
> >>
> >>
> > Disclaimer: I haven't had a chance to closely examine Ryo's patch..
>
> svn-trunk now has an adapted version of Ryo's patch. I've dropped the
> --with-pgsql-bytea stuff so the code is using bytea by default for pgsql.
At first, I used the encode() function to decode data of bytea
type to text type like Robert did.
But the encode() returns ONE backslash in the database('\') as
TWO backslashes ('\').
pgdb=> select encode('\\134'::bytea, 'escape');
encode
--------
\\
(1 row)
pgdb=> select encode('\\\\'::bytea, 'escape');
encode
--------
\\
(1 row)
So, I chose the PQunescapeBytea() function. Therefore it became
complicated.
But PQescapeBytea() and PQunescapeBytea() function is very slow...
Regards,
--
Ryo HAYAKAWA
[EMAIL PROTECTED]