Getting error ERROR: date/time field value out of range: "31 APR 2001 in Postgres
I have a varchar field where dates are stored in the database where I need data from with values like 31 APR 2001 I run the following query
select date(trim(contact_date)) from clients where date(trim(contact_date)) < '2002-03-12';
Whenever it hits 31 APR 2001 I get the error ERROR: date/time field value out of range: "31 APR 2001
Are there any workaround so that I won't get this error. Since all other dates get retur开发者_高级运维n perfectly.
The version of postgres I use is PostgreSQL 8.1.22
There are 30 days in the month of April.
there is no 31 in April month, prevent it from hitting 31 check it before query
精彩评论