X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0AFEA52843 for ; Wed, 1 Jun 2005 18:22:11 -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 29027-01 for ; Wed, 1 Jun 2005 21:22:06 +0000 (GMT) Received: from curry.tmsl.demon.co.uk (tmsl-adsl.demon.co.uk [80.177.114.181]) by svr1.postgresql.org (Postfix) with ESMTP id 5ED485292F for ; Wed, 1 Jun 2005 18:22:04 -0300 (ADT) Received: from bacon.tmsl.demon.co.uk (bacon.tmsl.demon.co.uk [192.168.7.102]) by curry.tmsl.demon.co.uk (8.11.6/8.11.6) with ESMTP id j51LM0B02007; Wed, 1 Jun 2005 22:22:00 +0100 Date: Wed, 1 Jun 2005 22:21:56 +0100 From: Paul Thomas To: Greg Alton Cc: pgsql-jdbc@postgresql.org Subject: Re: Backslashes in Strings being removed Message-ID: <20050601222156.C9013@bacon> References: <429E08A0.6050403@cfdev.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 In-Reply-To: <429E08A0.6050403@cfdev.com>; from greg@cfdev.com on Wed, Jun 01, 2005 at 20:12:32 +0100 X-Mailer: Balsa 1.2.3 Lines: 20 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/3 X-Sequence-Number: 12965 On 01/06/2005 20:12 Greg Alton wrote: > Hi All, > > How should the backslash character be excaped before storing in pgsql? I > assumed it would be another backslach, but that doesn't seem to work and > the backslash is dropped. > > My first post and excuse me if this is the wrong place or a frequently > asked question. I did not find any posts specific to this, but many of > you must have encountered it. Use PreparedStatements and the driver will correctly escape it for you. -- Paul Thomas +------------------------------+-------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+-------------------------------------------+