title: Importing bytea data into PostgreSQL by using COPY FROM stdin
body: <p>I generated a (UTF-8) file by an external program for importing into PostgreSQL 9.6.1. Problem is the <code>bytea</code> field (PWHASH).</p>
  
  <p>Snippet from this file (using TAB as delimiter)</p>
  
  <pre><code>COPY USERS (ID,CODE,PWHASH,EMAIL) FROM stdin;
  7   test1   E'\\\\x657B954D27B4AC56FA997D24A5FF2563'    test@amce.org
  \.
  </code></pre>
  
  <p>When importing with</p>
  
  <pre><code>psql mydb myrole -f test.sql
  </code></pre>
  
  <p>Everything goes well.</p>
  
  <p>However, if i query the result, the byte array is not 16 bytes, but 37 bytes:</p>
  
  <pre><code>select passwordhash,length(passwordhash) from users;
                                   passwordhash                                 | length 
  ------------------------------------------------------------------------------+--------
   \x45275c78363537423935344432374234414335364641393937443234413546463235363327 |     37
  </code></pre>
  
  <p>What is the correct syntax for this?</p>