title: Finding columns that are NOT NULL in PostgreSQL
body: <p>I had an assignment for each table to count nullable columns. Easy:</p>
  
  <pre><code> SELECT table_name, count(*) FROM INFORMATION_SCHEMA.COLUMNS
   WHERE is_nullable='NO'
   GROUP BY table_name;
  </code></pre>
  
  <p><br>
  Now I have to modify this to count "columns that have property "NOT NULL"". Will the following code do this or will it just check weather column name is not null?</p>
  
  <pre><code>CREATE TEMP TABLE A AS 
  SELECT DISTINCT column_name, table_name AS name FROM INFORMATION_SCHEMA.COLUMNS
  WHERE column_name IS NOT NULL
  GROUP BY table_name, column_name;
  
  SELECT name, count(*) FROM A
  GROUP BY name;
  </code></pre>
  
  <p>If no... Any advices?</p>