title: Why doesn't the PostgreSQL COPY command allow NULL values inside arrays?
body: <p>I have the following table definition:</p>
  
  <pre><code>create table null_test (some_array character varying[]);
  </code></pre>
  
  <p>And the following SQL file containing data.</p>
  
  <pre><code>copy null_test from stdin;
  {A,\N,B}
  \.
  </code></pre>
  
  <p>When unnesting the data (with <code>select unnest(some_array) from null_test</code>), the second value is "N", when I am expecting NULL.</p>
  
  <p>I have tried changing the data to look as follows (to use internal quotes on the array value):</p>
  
  <pre><code>copy null_test from stdin;
  {"A",\N,"B"}
  \.
  </code></pre>
  
  <p>The same non-null value "N" is inserted?</p>
  
  <p>Why is this not working and is there a workaround for this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>As per the accepted answer, the following worked. However, the two representation of NULL values within a COPY command depending on whether you're using single or array values is inconsistent.</p>
  
  <pre><code>copy null_test from stdin;
  {"A",NULL,"B"}
  \.
  </code></pre>