Where condition doesn't work as expected - Mailing list pgsql-novice

From William Colls
Subject Where condition doesn't work as expected
Date
Msg-id c01c8c2d-e9ec-03a1-4d13-282f084143f5@williamcollsassoc.ca
Whole thread Raw
Responses RE: Where condition doesn't work as expected  (Ken Benson <Ken@infowerks.com>)
Re: Where condition doesn't work as expected  (Bzzzz <lazyvirus@gmx.com>)
List 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.




pgsql-novice by date:

Previous
From: ALT SHN
Date:
Subject: Re: Coalesce in PostgreSQL trigger does not fire on upddate
Next
From: Ken Benson
Date:
Subject: RE: Where condition doesn't work as expected