I had to make a simple change to all the strings in a table, and I was dreading having to load them into memory, iterate over them, searching for the string, and updating replacements. So instead, I learned that postgresql can actually do regex replacements in an update statement.
For example, if I have a links
table with a url
column with a bunch of URLs erroneously ending in "?":
Link.where("long_url like '%?'").count #=> 487185