title: PostgreSQL function call
body: <p>I have PostgreSQL function named <code>test(integer)</code> taking an <code>integer</code> parameter and an overloaded function of the same name <code>test(character varying)</code>.</p>
  
  <p>When calling this function with a null value, Postgres always executes the function taking an <code>integer</code> parameter. Why does this happen? Why doesn't Postgres chose the function with a <code>varchar</code> parameter?</p>
  
  <p>Function call example:</p>
  
  <pre><code>select test(null);
  </code></pre>