Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id BBCEA9FA178 for ; Wed, 13 Dec 2006 13:48:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 53252-08 for ; Wed, 13 Dec 2006 13:48:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id 04B019FA173 for ; Wed, 13 Dec 2006 13:48:32 -0400 (AST) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 13 Dec 2006 09:47:46 -0800 Subject: Re: String escaping? From: Mark Lewis To: Heikki Linnakangas Cc: David Nedrow , pgsql-jdbc@postgresql.org In-Reply-To: <4580368D.8070300@enterprisedb.com> References: <50899926-5B68-42EC-B126-75EBC7E38BF4@mac.com> <4580368D.8070300@enterprisedb.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: MIR3, Inc. Date: Wed, 13 Dec 2006 09:47:46 -0800 Message-Id: <1166032066.27428.92.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27.rhel4.6) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/67 X-Sequence-Number: 16299 The only exception to this rule is backslashes and (when using LIKE) the '%' and '_' characters. Although if you're running 8.2 and turn the standard_conforming_strings setting ON then you don't need to worry about backslashes. -- Mark Lewis On Wed, 2006-12-13 at 17:21 +0000, Heikki Linnakangas wrote: > David Nedrow wrote: > > Are there any build-in JDK or JDBC (Sun or Postgresql driver) functions > > for escaping strings before inserting/updating in the DB? > > > > Eg., I'm using the following PreparedStatement... > > You don't generally need to escape your strings if you're using > PreparedStatements. >