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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, 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 14:10:42
Message-ID: 212.1244643042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-06-10 14:42:08 Re: pgindent run coming
Previous Message Andy Colson 2009-06-10 13:51:00 Re: Multicolumn index corruption on 8.4 beta 2