Re: Junk date getting uploaded into date field - Mailing list pgsql-general

From Michael Nolan
Subject Re: Junk date getting uploaded into date field
Date
Msg-id CAOzAquL9w1-4uzdGmDPfkRkQ0r+=KaLHmKh3QubWkggMUoKKmw@mail.gmail.com
Whole thread Raw
In response to Re: Junk date getting uploaded into date field  (bsreejithin <bsreejithin@gmail.com>)
List pgsql-general
On 11/5/13, bsreejithin <bsreejithin@gmail.com> wrote:
>
> I am not sure why : select to_date('33-OCT-2013', 'dd-mon-yyyy')
>
> is returning 2013-11-02.
>
> For cases like the issue I am facing, where we need to raise an error
> saying
> the data is wrong, DB manipulating the data is not proper.

Try using a cast to date instead:

select '33-oct-2013'::date throws an error.
--
Mike Nolan


pgsql-general by date:

Previous
From: Jing Fan
Date:
Subject: Re: WITH RECURSIVE doesn't work properly for me
Next
From: Edson Richter
Date:
Subject: Re: Curious question about physical files to store database