Query failed: ERROR: syntax error at end of input LINE 1: ...esce (avg(score)::int, 0) from tvotings where resource_id = ^