title: Escaping backslash in Postgresql
body: <p>I'm trying to write an sql function in Postgresql that will parse a file path.
  I want to return just the file name.</p>
  
  <p>I cannot get past getting an accurate text string in the function.</p>
  
  <p>Here is the function:</p>
  
  <pre><code>Function:  job_page("inputText" text)
  DECLARE
      $5 text;
  
  BEGIN
      $5 = quote_literal("inputText");
      return $5;
  END
  </code></pre>
  
  <p>When I run this:</p>
  
  <pre><code>select job_page('\\CAD_SVR\CADJOBS\7512-CEDARHURST ELEMENTARY SCHOOL\7512-20.DWG')
  </code></pre>
  
  <p>I get this result:</p>
  
  <pre><code>"E'\\CAD_SVRCADJOBSé2-CEDARHURST ELEMENTARY SCHOOLé2-20.DWG'"
  </code></pre>
  
  <p>Postgresql interprets the slash followed by certain characters as a special character.</p>
  
  <p>How do I escape?</p>