Re: Getting error while trying to insert date with the format 'dd-month-yyyy' , 'day-mm-yyyy' etc..

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, hope(dot)jiang(at)enterprisedb(dot)com, ahsan(dot)hadi(at)enterprisedb(dot)com
Subject: Re: Getting error while trying to insert date with the format 'dd-month-yyyy' , 'day-mm-yyyy' etc..
Date: 2009-06-10 18:32:25
Message-ID: 200906102132.27090.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday 10 June 2009 17:10:42 Tom Lane wrote:
> Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com> writes:
> > Getting error while trying to insert date with the format 'dd-month-yyyy'
> > , 'day-mm-yyyy' (format which add the space in between the date ) etc..
>
> 1. Why are you bothering with the completely pointless to_char call at all?

Random guess for entertainment: Oracle applications do this sort of thing all
the time.

> 2. It is not a bug that to_char is capable of emitting formats that
> won't be read by the standard datetime input converter. If you insist
> on making a useless conversion to char and back, it's on your head to
> choose a format setting that will work.

Of course they then also use to_date all the time.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-10 18:32:58 Re: Resolving 8.4 open items
Previous Message Tom Lane 2009-06-10 18:29:50 Re: pgindent run coming