title: sqlite IFNULL() in postgres
body: <p>What is the equivalent of SQLite's <code>IFNULL()</code> in Postgres?</p>
  
  <p>I have to following query (sqlite in Ruby):</p>
  
  <pre><code>SELECT ifnull(max(code_id) + 1, 1) 
  FROM configentries 
  WHERE configtable_id = ...
  </code></pre>
  
  <p>How should this look like if I want the same result with PostgreSQL?</p>