X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7186752812 for ; Mon, 1 Aug 2005 01:54:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98576-09 for ; Mon, 1 Aug 2005 04:54:38 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id A937D52AFC for ; Mon, 1 Aug 2005 01:54:37 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j714rMLp024658; Mon, 1 Aug 2005 00:53:22 -0400 (EDT) To: Michael Parker Cc: pgsql-performance@postgresql.org Subject: Re: Performance problems testing with Spamassassin 3.1.0 In-reply-to: <20050801040443.GA6527@mail.herk.net> References: <42E80C28.2040608@aptalaska.net> <1122532023.25574.1.camel@localhost.localdomain> <42E9749F.6000709@aptalaska.net> <1122616211.5691.340.camel@lamb.mcmillan.net.nz> <42EA6966.8090402@aptalaska.net> <1122668371.5691.352.camel@lamb.mcmillan.net.nz> <19405.1122670917@sss.pgh.pa.us> <42EAA410.9010700@aptalaska.net> <27897.1122748133@sss.pgh.pa.us> <20050801040443.GA6527@mail.herk.net> Comments: In-reply-to Michael Parker message dated "Sun, 31 Jul 2005 23:04:49 -0500" Date: Mon, 01 Aug 2005 00:53:22 -0400 Message-ID: <24657.1122872002@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200508/3 X-Sequence-Number: 13750 Michael Parker 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