I searched around quite a bit, it would be great if someone could link me to a solution or answer my query.
The thing is I have a postgresql table that contains a lot of single quotes and I cant figure out how to get rid of them, because obviously this
update tablename set fieldname= NULL where fieldname=' ;
wont work.
Better use replace() for this:
Much faster than
regexp_replace(), and it replaces "globally": all occurrences of the search string. To achieve the same withregexp_replace(), add an optional 4th parameter:'g'for "globally".Aside: the canonical (and SQL standard) way to escape single quotes (
') in string literals is to double them (''). Using Posix style escape sequences works, too, of course. See: