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

From Tom Lane
Subject Re: Junk date getting uploaded into date field
Date
Msg-id 16999.1383663836@sss.pgh.pa.us
Whole thread Raw
In response to Re: Junk date getting uploaded into date field  (bsreejithin <bsreejithin@gmail.com>)
List pgsql-general
bsreejithin <bsreejithin@gmail.com> writes:
> 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.

Then don't use to_date().  Just entering the string through the normal date
type input function will do what you want.  to_date() is meant for trying
to extract data from weird input formats.

            regards, tom lane


pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: WITH RECURSIVE doesn't work properly for me
Next
From: Jing Fan
Date:
Subject: Re: WITH RECURSIVE doesn't work properly for me