New to PostgreSQL (and only 6 months more experienced in programming in general), having problems with following query:
TutoringSession.where("extract (DOW from begin_time)
= extract DOW from (?)", Time.now)
Gives me the following error message:
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'))
I have looked through the PostgreSQL documentation. Any ideas?