You might want to use replace:
SELECT REPLACE(text, '"', E'\\"') FROM aTable WHERE ...
You will need to escape the escape character to get a literal backslash (hence double the backslash) and use the prefix "E" on the replacement string to get the correct escape .
. a_horse_with_no_name ( BTW) , "E":
set standard_conforming_strings = on;
SELECT REPLACE(text, '"', '\"') FROM aTable WHERE ...
standard_conforming_strings PostgreSQL SQL:
, ('...') , SQL.
\x5C escape:
standard_conforming_strings , PostgreSQL , escape-. , .