Re: how to insert '\\' in postgres database using java - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: how to insert '\\' in postgres database using java
Date
Msg-id 665948BE-4FD8-4744-9395-5302C5872B8F@myrealbox.com
Whole thread Raw
In response to how to insert '\\' in postgres database using java  (ketan shah <ketan_dba@yahoo.com>)
List 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


pgsql-general by date:

Previous
From: Matt Miller
Date:
Subject: CVS - psql segfault
Next
From: Berend Tober
Date:
Subject: Re: How to create unique constraint on NULL columns