In postgres i use like query to find the a specific word in a column for example in a column i have text "Small state in wmost Brazil bordered by sw Amazonas, Peru, and Bolivia."
with like query i can find text that contains text "wmost" after finding that i want to replace or update "wmost" to "westernmost" in that text.
is there a way to do that?
Please need urgent help in this matter.
We have created a table message(id,data);
Use the following query:
update message set data = replace (data, 'wmost','westernmost');
thanks a lot i could do it with this, but the only problem is if i want to change "nmost" to "northernmost" this query also changes "southernmost" to "southernothernmost". if you notice then "nmost" is common in other strings also. is there a way to avoid this problem. Can you send similar query using regexp_replace expression so that it only identifies "nmost" and not anyone of these: southernmost, easternmost, northernmost, westernmost.
Really appreciate your help.