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

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: how to insert '\\' in postgres database using java
Дата
Msg-id 665948BE-4FD8-4744-9395-5302C5872B8F@myrealbox.com
обсуждение исходный текст
Ответ на how to insert '\\' in postgres database using java  (ketan shah <ketan_dba@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Matt Miller
Дата:
Сообщение: CVS - psql segfault
Следующее
От: Berend Tober
Дата:
Сообщение: Re: How to create unique constraint on NULL columns