> service0=#
> service0=# SELECT DISTINCT machine_id
> service0-# FROM user_sessions
> service0-# WHERE TO_CHAR(session_start, 'Month') = 'April';
>
> machine_id
> ------------
> (0 rows)
>
Since to_char function pads space to the value returned. The length of the
return value of to_char function is 9. It is mentioned in the document,
please refer the below link for details:
http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-formatting.html
You can use rtrim to get rid of your problem.
=> select distinct machine_id from user_sessions where rtrim (to_char
(session_start, 'Month')) = 'April';
regards,
bhuvaneswaran