title: Select today's (since midnight) timestamps only
body: <p>I have a server with PostgreSQL 8.4 which is being rebooted every night at 01:00 (don't ask) and need to get a list of connected users (i.e. their timestamps are <code>u.login &gt; u.logout</code>):</p>
  
  <pre><code>SELECT u.login, u.id, u.first_name
  FROM pref_users u
  WHERE u.login &gt; u.logout and 
        u.login &gt; now() - interval '24 hour'
  ORDER BY u.login;
  
             login            |           id   | first_name
  ----------------------------+----------------+-------------
   2012-03-14 09:27:33.41645  | OK171511218029 | Alice
   2012-03-14 09:51:46.387244 | OK448670789462 | Bob
   2012-03-14 09:52:36.738625 | OK5088512947   | Sergej
  </code></pre>
  
  <p>But comparing <code>u.login &gt; now()-interval '24 hour'</code> also delivers the users before the last 01:00, which is bad, esp. in the mornings.</p>
  
  <p>Is there any efficient way to <strong>get the logins since the last 01:00</strong> without doing string acrobatics with <code>to_char()</code>?</p>