pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Altaf Malik <mmalik_altaf@yahoo.com>
To: roman <xroot@mail.ru>
To: pgsql-jdbc@postgresql.org
Subject: Re: postgresql-8.2-504.jdbc4.jar and backslash
Date: Mon, 7 May 2007 00:20:22 -0700 (PDT)
Message-ID: <506454.29623.qm@web39104.mail.mud.yahoo.com> (raw)
In-Reply-To: <00c401c7906f$1ada1d20$5405a8c0@nnp.nsk.su>

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 outnew cars at Yahoo! Autos.

view thread (2+ messages)

Message-ID: <506454.29623.qm@web39104.mail.mud.yahoo.com>
Permalink:  ../506454.29623.qm@web39104.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/506454.29623.qm@web39104.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mmalik_altaf@yahoo.com, xroot@mail.ru
  Subject: Re: postgresql-8.2-504.jdbc4.jar and backslash
  In-Reply-To: <506454.29623.qm@web39104.mail.mud.yahoo.com>
  References: <00c401c7906f$1ada1d20$5405a8c0@nnp.nsk.su> <506454.29623.qm@web39104.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox