When inserting data on a Postgres database, I make extensive use of escaped strings as described here:
https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNT