Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C3F459FB565 for ; Mon, 7 May 2007 04:20:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 04526-01 for ; Mon, 7 May 2007 04:20:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web39104.mail.mud.yahoo.com (web39104.mail.mud.yahoo.com [209.191.87.32]) by postgresql.org (Postfix) with SMTP id 7DF9A9FB54D for ; Mon, 7 May 2007 04:20:23 -0300 (ADT) Received: (qmail 30536 invoked by uid 60001); 7 May 2007 07:20:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=ZT6p04MGa9E15ysoiPK/XDu5aOTav7C57ZZly/qelaL4VjF7h08sBHmRmOsMm3VS6N69KbqxJ8qh1yQubAVib/AQhM8MV8byVtaTXbaJF7IGKkZ9+1TolJOfGfBy9jeqOyiXnSZGh+99ZCNv5BsQf6oIQNApRhBXM4FLAp80jic=; X-YMail-OSG: vdPg0cEVM1mX1gbgVD8Htu0GQ1rIHcio052qitVvb7fB0l5hI9qZrX47UuQsGhkeDwlMWR3BkLYbMqiodJvfiVHFCxx6Tq7r.BYHAIwizlcHfvb1Qr2q1w8Lw1p5Ng-- Received: from [203.215.160.146] by web39104.mail.mud.yahoo.com via HTTP; Mon, 07 May 2007 00:20:22 PDT Date: Mon, 7 May 2007 00:20:22 -0700 (PDT) From: Altaf Malik Subject: Re: postgresql-8.2-504.jdbc4.jar and backslash To: roman , pgsql-jdbc@postgresql.org In-Reply-To: <00c401c7906f$1ada1d20$5405a8c0@nnp.nsk.su> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1579016142-1178522422=:29623" Content-Transfer-Encoding: 8bit Message-ID: <506454.29623.qm@web39104.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.062 tagged_above=0 required=5 tests=AWL=0.171, BAYES_00=-2.599, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447, HTML_50_60=0.134, HTML_MESSAGE=0.001 X-Spam-Level: * X-Archive-Number: 200705/19 X-Sequence-Number: 17009 --0-1579016142-1178522422=:29623 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit You are using wrong escape characters. \\ is java escape character, which in turn becomes \ so your String becomes: UPDATE "table1" SET "field1"='f:\temp' And when you fetch the data, f:\temp becomes f: emp because \t is an escape sequence for tab. Using escape characters, \\ should be written as \\\\ which will convert to \\ --Altaf Malik roman wrote: Hello. I use this jar driver for connection to postgresql 8.2.3-1 in Windows XP. In my database I use UFT8 codepage. I need to save some filepath in some character varying(255) field in table1. That path looks like this: f:\temp in String class like this: "f:\\temp"; I try to execute following SQL statement: UPDATE "table1" SET "field1"='f:\\temp' in String object it looks like: "UPDATE \"table1\" SET \"field1\"='f:\\temp'". After statement executed I get on SELECT folowing: f:emp Why? There were two back slashes!!! When I try to execute that update statement in pgAdminIII everything is OK!!! Please, help me to decide this problem. How can I save filepath with backslashes? --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. --0-1579016142-1178522422=:29623 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit You are using wrong escape characters. \\ is java escape character, which in turn becomes \ so your String becomes:
UPDATE "table1" SET "field1"='f:\temp'
And when you fetch the data, f:\temp becomes f:   emp
because \t is an escape sequence for tab.

Using escape characters, \\ should be written as \\\\ which will convert to \\

--Altaf Malik

roman <xroot@mail.ru> wrote:
Hello.
I use this jar driver for connection to postgresql 8.2.3-1 in Windows XP.
In my database I use UFT8 codepage.
I need to save some filepath in some character varying(255) field in table1.
That path looks like this: f:\temp
in String class like this: "f:\\temp";
I try to execute following SQL statement:
UPDATE "table1" SET "field1"='f:\\temp'
in String object it looks like: "UPDATE \"table1\" SET \"field1\"='f:\\temp'".
After statement executed I get on SELECT folowing:
f:<tab symbol>emp
 
Why? There were two back slashes!!!

When I try to execute that update statement in pgAdminIII everything is OK!!!
 
Please, help me to decide this problem. How can I save filepath with backslashes?


Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos. --0-1579016142-1178522422=:29623--