title: Why no "division by zero" error in PostgreSQL for such case?
body: <p>Noticed the following behavior of PostgreSQL 9.5:</p>
  
  <p>Division of something by zero - works as expected:</p>
  
  <pre><code># select 1 / 0;
  ERROR:  division by zero
  </code></pre>
  
  <p>Dividing <code>NULL</code> by zero:</p>
  
  <pre><code># select NULL / 0;
   ?column?
  ----------
  
  (1 row)
  </code></pre>
  
  <p>I browsed the documentation, but didn't find any reference to the reasons for such a design decision. The result of the dividend can depend on data - can be something or <code>NULL</code>, so the result - <code>NULL</code> or error - will depend on data. Wouldn't that be safer to throw error in all cases when divisor is known to be zero?</p>