title: NodeJS: How do I escape special characters in SQL query for PostgreSQL?
body: <p>I've found few similar questions here, but no one contains sufficient answer.<br>
  Webapp has bunch of input fields. I need to escape all the special characters when i'm attempting to <code>INSERT</code> input's values into PG 9.5 database.
  This one looks good:<br>
  <a href="https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex">Escape string for use in Javascript regex</a><br>
  But it doesn't escape quotes. Due to this, I suppose, it may not escape other special characters.<br>
  Some other suggestions modifies the original value. E.g. if i'm posting a comment, and this comment contain one single quote, then i want to see exactly one single quote, when this comment gets rendered from database.</p>