Обсуждение: replace

Поиск
Список
Период
Сортировка

replace

От
ingoos
Дата:
i need to convert some stings in old database, where \ is one letter in
croatian language. 

when i'm using 

replace ('abcd\efg', '\', 'XX') i got error. 

anyone can help how to solver this problem ?

tnx



--
View this message in context: http://postgresql.1045698.n5.nabble.com/replace-tp5768024.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.



Re: replace

От
Paolo Saudin
Дата:
Here on 9.2.4 just work fine :

select replace ('abcd\efg', '\', 'XX');
+-----------+
|  replace  |
+-----------+
| abcdXXefg |
+-----------+

paolo



2013/8/20 ingoos <ingoos@gmail.com>
i need to convert some stings in old database, where \ is one letter in
croatian language.

when i'm using

replace ('abcd\efg', '\', 'XX') i got error.

anyone can help how to solver this problem ?

tnx



--
View this message in context: http://postgresql.1045698.n5.nabble.com/replace-tp5768024.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.


--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: replace

От
ingoos
Дата:
9.2.4. ??

i'm using pgAdmin 1.16.1

and error is 

WARNING:  nonstandard use of escape in a string literal
LINE 1: select replace ('abcd\efg', '\', 'XX');                       ^
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING:  nonstandard use of \' in a string literal
LINE 1: select replace ('abcd\efg', '\', 'XX');                                   ^





--
View this message in context: http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.



Re: replace

От
Alexander Yerenkow
Дата:

Put letter E before each string.

E'\'

Like this.

Regards, Alexander Yerenkow

20.08.2013 16:02 пользователь "ingoos" <ingoos@gmail.com> написал:
9.2.4. ??

i'm using pgAdmin 1.16.1

and error is

WARNING:  nonstandard use of escape in a string literal
LINE 1: select replace ('abcd\efg', '\', 'XX');
                        ^
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING:  nonstandard use of \' in a string literal
LINE 1: select replace ('abcd\efg', '\', 'XX');
                                    ^





--
View this message in context: http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.


--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: replace

От
Rui Hua
Дата:

Hi,
   where does your 'abcd\efg' data resource come from ? if application program data was passed into database,you should make '\' into '\\', Then,
   execute the following command:
   select replace ('abcd\\efg', '\\', 'XX'); 

replace text

    1 

abcdXXefg

Put letter E before each string.

E'\'

Like this.

Regards, Alexander Yerenkow

20.08.2013 16:02 пользователь "ingoos" <ingoos@gmail.com> написал:
9.2.4. ??

i'm using pgAdmin 1.16.1

and error is

WARNING:  nonstandard use of escape in a string literal
LINE 1: select replace ('abcd\efg', '\', 'XX');
                        ^
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING:  nonstandard use of \' in a string literal
LINE 1: select replace ('abcd\efg', '\', 'XX');
                                    ^





--
View this message in context: http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.


--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support