In postgresql, how do I replace all instances of a string within a database column?
Say I want to replace all instances of cat with dog, fo
cat
dog
You can use the replace function
replace
UPDATE your_table SET field = REPLACE(your_field, 'cat','dog')
The function definition is as follows (got from here):
replace(string text, from text, to text)
and returns the modified text. You can also check out this sql fiddle.