title: date_trunc on timestamp column returns nothing
body: <p>I have a strange problem when retrieving records from db after comparing a truncated field with <code>date_trunc()</code>.</p>
  
  <p>This query doesn't return any data:</p>
  
  <pre><code>select id from my_db_log 
   where date_trunc('day',creation_date) &gt;= to_date('2014-03-05'::text,'yyyy-mm-dd');
  </code></pre>
  
  <p>But if I add the column <code>creation_date</code> with <code>id</code> then it returns data(i.e. <code>select id, creation_date...</code>).</p>
  
  <p>I have another column <code>last_update_date</code> having same type and when I use that one, still does the same behavior.</p>
  
  <pre><code>select id from my_db_log
   where date_trunc('day',last_update_date) &gt;= to_date('2014-03-05'::text,'yyyy-mm-dd');
  </code></pre>
  
  <p>Similar to previous one. it also returns record if I do <code>id, last_update_date</code> in my <code>select</code>.</p>
  
  <p>Now to dig further, I have added both <code>creation_date</code> and <code>last_updated_date</code> in my <code>where</code> clause and this time it demands to have both of them in my <code>select</code> clause to have records(i.e. <code>select id, creation_date, last_update_date</code>).</p>
  
  <p>Does anyone encountered the same problem ever? This similar thing works with my other tables which are having this type of columns!</p>
  
  <p>If it helps, here is my table schema:</p>
  
  <pre><code>id serial NOT NULL,
  creation_date timestamp without time zone NOT NULL DEFAULT now(),
  last_update_date timestamp without time zone NOT NULL DEFAULT now(),
  CONSTRAINT db_log_pkey PRIMARY KEY (id),
  </code></pre>
  
  <p>I have asked a different question earlier that didn't get any answer. This problem may be related to that one. If you are interested on that one, here is <a href="https://stackoverflow.com/questions/22191982/attribute-number-10-exceeds-number-of-columns-0">the link</a>.</p>
  
  <p><b>EDITS::</b> <code>EXPLAIN (FORMAT XML)</code> with <code>select *</code> returns:</p>
  
  <pre><code>&lt;explain xmlns="http://www.postgresql.org/2009/explain"&gt;
    &lt;Query&gt;
      &lt;Plan&gt;
        &lt;Node-Type&gt;Result&lt;/Node-Type&gt;
        &lt;Startup-Cost&gt;0.00&lt;/Startup-Cost&gt;
        &lt;Total-Cost&gt;0.00&lt;/Total-Cost&gt;
        &lt;Plan-Rows&gt;1000&lt;/Plan-Rows&gt;
        &lt;Plan-Width&gt;658&lt;/Plan-Width&gt;
        &lt;Plans&gt;
          &lt;Plan&gt;
            &lt;Node-Type&gt;Result&lt;/Node-Type&gt;
            &lt;Parent-Relationship&gt;Outer&lt;/Parent-Relationship&gt;
            &lt;Alias&gt;my_db_log&lt;/Alias&gt;
            &lt;Startup-Cost&gt;0.00&lt;/Startup-Cost&gt;
            &lt;Total-Cost&gt;0.00&lt;/Total-Cost&gt;
            &lt;Plan-Rows&gt;1000&lt;/Plan-Rows&gt;
            &lt;Plan-Width&gt;658&lt;/Plan-Width&gt;
            &lt;Node/s&gt;datanode1&lt;/Node/s&gt;
            &lt;Coordinator-quals&gt;(date_trunc('day'::text, creation_date) &amp;gt;= to_date('2014-03-05'::text, 'yyyy-mm-dd'::text))&lt;/Coordinator-quals&gt;
          &lt;/Plan&gt;
        &lt;/Plans&gt;
      &lt;/Plan&gt;
    &lt;/Query&gt;
  &lt;/explain&gt;
  </code></pre>