On 11/5/13, bsreejithin <bsreejithin@xxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general