title: Behaviour of NOT LIKE with NULL values
body: <p>I want to fetch all columns of a table except of columns of type serial. The closest query to this problem I was able to come up with this one:</p>
  
  <pre><code>SELECT column_name FROM information_schema.columns
  WHERE table_name = 'table1' AND column_default NOT LIKE 'nextval%'
  </code></pre>
  
  <p>But the problem is its also excluding/filtering rows having empty values for column_default.I don't know why the behaviour of Postgres is like this. So I had to change my query to something like this:</p>
  
  <pre><code>SELECT column_name FROM information_schema.columns
  WHERE table_name = 'table1'
  AND ( column_default IS NULL OR column_default NOT LIKE 'nextval%')
  </code></pre>
  
  <p>Any better suggestions or rationale behind this are welcome.</p>