Re: Performance problems testing with Spamassassin 3.1.0

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Performance problems testing with Spamassassin 3.1.0
Дата
Msg-id 24657.1122872002@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Performance problems testing with Spamassassin 3.1.0  (Michael Parker <parkerm@pobox.com>)
Ответы Re: Performance problems testing with Spamassassin 3.1.0  (Matthew Schumacher <matt.s@aptalaska.net>)
Список pgsql-performance
Michael Parker <parkerm@pobox.com> writes:
> sub bytea_esc {
>   my ($str) = @_;
>   my $buf = "";
>   foreach my $char (split(//,$str)) {
>     if (ord($char) == 0) { $buf .= "\\\\000"; }
>     elsif (ord($char) == 39) { $buf .= "\\\\047"; }
>     elsif (ord($char) == 92) { $buf .= "\\\\134"; }
>     else { $buf .= $char; }
>   }
>   return $buf;
> }

Oh, I see the problem: you forgot to convert " to a backslash sequence.

It would probably also be wise to convert anything >= 128 to a backslash
sequence, so as to avoid any possible problems with multibyte character
encodings.  You wouldn't see this issue in a SQL_ASCII database, but I
suspect it would rise up to bite you with other encoding settings.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Performance problems testing with Spamassassin 3.1.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] COPY FROM performance improvements