title: PostgreSQL in Rails query is not working
body: <p>New to PostgreSQL (and only 6 months more experienced in programming in general), having problems with following query:</p>
  
  <pre><code>TutoringSession.where("extract (DOW from begin_time)
                       = extract DOW from (?)", Time.now)
  </code></pre>
  
  <p>Gives me the following error message:</p>
  
  <pre><code>ActiveRecord::StatementInvalid: PG::Error: ERROR:  syntax error at or near "DOW"
  LINE 1: ..."  WHERE (extract (DOW from begin_time) = extract DOW from (...
                                                               ^
  : SELECT "tutoring_sessions".* FROM "tutoring_sessions"  WHERE (extract (DOW from   begin_time) = extract DOW from ('2012-04-18 14:39:58.202249'))
  </code></pre>
  
  <p>I have looked through the PostgreSQL documentation. Any ideas?</p>