title: PostgreSQL import from CSV NULL values are text - Need null
body: <p>I had exported a bunch of tables (&gt;30) as CSV files from MySQL database using phpMyAdmin. These CSV file contains <code>NULL</code> values like:</p>
  <pre><code>&quot;id&quot;,&quot;sourceType&quot;,&quot;name&quot;,&quot;website&quot;,&quot;location&quot;
  &quot;1&quot;,&quot;non-commercial&quot;,&quot;John Doe&quot;,NULL,&quot;California&quot;
  </code></pre>
  <p>I imported many such csv to a PostgreSQL database with TablePlus. However, the <code>NULL</code> values in the columns are actually appearing as text rather than null.</p>
  <p>When my application fetches the data from these columns it actually retrieves the text <code>'NULL'</code> rather than a null value.</p>
  <p>Also SQL command with <code>IS NULL</code> does not retrieve these rows probably because they are identified as text rather than null values.</p>
  <p>Is there a SQL command I can do to convert all text <code>NULL</code> values in all the tables to actual NULL values? This would be the easiest way to avoid re-importing all the tables.</p>