Thread: replace

replace

From
ingoos
Date:
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

From
Paolo Saudin
Date:
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

From
ingoos
Date:
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

From
Alexander Yerenkow
Date:
<p dir="ltr">Put letter E before each string.<p dir="ltr">E'\'<p dir="ltr">Like this.<p dir="ltr">Regards, Alexander
Yerenkow<divclass="gmail_quote">20.08.2013 16:02 пользователь "ingoos" <<a
href="mailto:ingoos@gmail.com">ingoos@gmail.com</a>>написал:<br type="attribution" /><blockquote class="gmail_quote"
style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> 9.2.4. ??<br /><br /> i'm using pgAdmin 1.16.1<br
/><br/> and error is<br /><br /> WARNING:  nonstandard use of escape in a string literal<br /> LINE 1: select replace
('abcd\efg','\', 'XX');<br />                         ^<br /> HINT:  Use the escape string syntax for escapes, e.g.,
E'\r\n'.<br/> WARNING:  nonstandard use of \' in a string literal<br /> LINE 1: select replace ('abcd\efg', '\',
'XX');<br/>                                     ^<br /><br /><br /><br /><br /><br /> --<br /> View this message in
context:<a href="http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html"
target="_blank">http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html</a><br/> Sent from the
PostgreSQL- pgadmin support mailing list archive at Nabble.com.<br /><br /><br /> --<br /> Sent via pgadmin-support
mailinglist (<a href="mailto:pgadmin-support@postgresql.org">pgadmin-support@postgresql.org</a>)<br /> To make changes
toyour subscription:<br /><a href="http://www.postgresql.org/mailpref/pgadmin-support"
target="_blank">http://www.postgresql.org/mailpref/pgadmin-support</a><br/></blockquote></div> 

Re: replace

From
Rui Hua
Date:
<div class="moz-cite-prefix"><br /> Hi,<br />    where does your 'abcd\efg' data resource come from ? if application
programdata was passed into database,you should make '\' into '\\', Then,<br />    execute the following command:<br />
  select replace ('abcd\\efg', '\\', 'XX');  <table border="1" cellpadding="2" cellspacing="2" height="62"
width="253"><tbody><tr><td><br/></td><td valign="top">replace text</td></tr><tr><td><p class="MsoNormal"
style="text-indent:0cm;mso-char-indent-count:0;background:
white;mso-background-themecolor:background1"><spanstyle="mso-bookmark:OLE_LINK40"><span
style="mso-bookmark:OLE_LINK41"><spanlang="EN-US" style="color:black;mso-themecolor:                     text1">   
1<spanstyle="mso-spacerun:yes"> </span></span></span></span></td><td valign="top"><span
style="mso-bookmark:OLE_LINK40"><spanstyle="mso-bookmark:OLE_LINK41"><span lang="EN-US"
style="color:black;mso-themecolor:
text1">abcdXXefg</span></span></span></td></tr></tbody></table><spanstyle="mso-bookmark:OLE_LINK40"><span
style="mso-bookmark:OLE_LINK41"><spanlang="EN-US" style="color:black;mso-themecolor:
text1"></span></span></span><spanlang="EN-US" style="color:black;mso-themecolor:text1"></span></div><blockquote
cite="mid:CAPJF9w=XeXwpQqy7QDHP5goEsJpr=0fwNcBd9Y_8ayLfFyFVJA@mail.gmail.com"type="cite"><p dir="ltr">Put letter E
beforeeach string.<p dir="ltr">E'\'<p dir="ltr">Like this.<p dir="ltr">Regards, Alexander Yerenkow<div
class="gmail_quote">20.08.201316:02 пользователь "ingoos" <<a href="mailto:ingoos@gmail.com"
moz-do-not-send="true">ingoos@gmail.com</a>>написал:<br type="attribution" /><blockquote class="gmail_quote"
style="margin:00 0         .8ex;border-left:1px #ccc solid;padding-left:1ex"> 9.2.4. ??<br /><br /> i'm using pgAdmin
1.16.1<br/><br /> and error is<br /><br /> WARNING:  nonstandard use of escape in a string literal<br /> LINE 1: select
replace('abcd\efg', '\', 'XX');<br />                         ^<br /> HINT:  Use the escape string syntax for escapes,
e.g.,E'\r\n'.<br /> WARNING:  nonstandard use of \' in a string literal<br /> LINE 1: select replace ('abcd\efg', '\',
'XX');<br/>                                     ^<br /><br /><br /><br /><br /><br /> --<br /> View this message in
context:<a href="http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html" moz-do-not-send="true"
target="_blank">http://postgresql.1045698.n5.nabble.com/replace-tp5768024p5768044.html</a><br/> Sent from the
PostgreSQL- pgadmin support mailing list archive at Nabble.com.<br /><br /><br /> --<br /> Sent via pgadmin-support
mailinglist (<a href="mailto:pgadmin-support@postgresql.org"
moz-do-not-send="true">pgadmin-support@postgresql.org</a>)<br/> To make changes to your subscription:<br /><a
href="http://www.postgresql.org/mailpref/pgadmin-support"moz-do-not-send="true"
target="_blank">http://www.postgresql.org/mailpref/pgadmin-support</a><br/></blockquote></div></blockquote><br />