Where condition doesn't work as expected

William Colls <william@williamcollsassoc.ca>

From: William Colls <william@williamcollsassoc.ca>
To: pgsql-novice@lists.postgresql.org
Date: 2020-02-08T22:39:32Z
Lists: pgsql-novice
I have the following condition a select statement:

  WHERE "datetime" > '2019-03-31 23:59:59'

datetime is a character field with data in the format YYYY-MM-DD 
HH:MM:SS. However it returns any line where the datetime field begins 
with 2019. I suspect that I should be using timestamp values, but I 
can't figure out how to cast the datetime field value to a timestamp.

Thanks for your time.

William.