title: Rails query timestamp between two hours with postgresql
body: <p>I'm trying to get records from hours + minutes interval not connected with date in postgresql. For example all records from last month which were created between 15:15 and 18:30.</p>
  
  <p>I have found this <a href="https://stackoverflow.com/questions/19576109/rails-query-timestamp-between-two-hours">answer</a> but it does not work in postgresql.</p>
  
  <p>For only hours I tried</p>
  
  <pre><code>Review.where("extract('hour' from created_at) &gt; 15 AND extract('hour' from created_at) &lt; 18")
  
  SELECT "reviews".* FROM "reviews" WHERE (extract('hour' from created_at) &gt; 15 AND extract('hour' from created_at) &lt; 18)
  </code></pre>
  
  <p>however I have no idea how to deal with the minutes.</p>