Re: how to insert '\\' in postgres database using java

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: ketan shah <ketan_dba(at)yahoo(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to insert '\\' in postgres database using java
Date: 2005-07-15 15:49:03
Message-ID: 665948BE-4FD8-4744-9395-5302C5872B8F@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ketan,

Please reply to the list as well so others have the opportunity to
help you. And please don't top-post.

On Jul 16, 2005, at 12:31 AM, ketan shah wrote:
>
> but if i update more then two times then it remove all '\';
>
> and finally it returns 'Adddd' or 'Bdddd'...
>
> But i want 'A\\d\\d\\d\\d' and 'B\\d\\d\\d\\d' after n number of
> updates.
>
> i.e. no change in inserted value after n numbers of updates for
> that record.

If you don't change change the values of the usr_filename_pattern in
the update (in the SET clause), those values should not change.

test=# select * from tab1;
usr_id | usr_name | usr_filename_pattern
--------+----------+----------------------
A | Mr. A | A\d\d\d\d
A | Mr. B | A\\d\\d\\d\\d
(2 rows)

test=# update tab1 set usr_name = 'Mr. C' where usr_id = 'A';
UPDATE 2
test=# select * from tab1;
usr_id | usr_name | usr_filename_pattern
--------+----------+----------------------
A | Mr. C | A\d\d\d\d
A | Mr. C | A\\d\\d\\d\\d

I suspect there is some additional SQL code being executed by your
Java application. You may want to enable query logging and check the
PostgreSQL logs to see exactly what queries are being executed.

Michael Glaesemann
grzm myrealbox com

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2005-07-15 15:51:12 Re: How to create unique constraint on NULL columns
Previous Message Matt Miller 2005-07-15 15:47:20 CVS - psql segfault