title: to_char() issue in PostgreSQL
body: <p>I have a PostgreSQL table with a field named <code>effective_date</code> and data type is integer(epoch date). What I want to do is to select only the entries that have an effective_date of my choice (I only want to query by the month). My query is below and the problem is, it is not returning anything although the table do have many entries that match the selection criteria.</p>
  
  <pre><code>$query = "select    *
            from ". $this-&gt;getTable() ."
            where pay_stub_entry_name_id = 43
            AND to_char(effective_date, 'Mon') = 'Jul'
            AND deleted = 0";
  </code></pre>