On 4 March 2010 04:08, Tom Lane wrote:
> Brendan Jurd writes:
>> For example, you're trying to import a date that is written as "Wed
>> 3rd March, Q1 2010". You might give to_date a format string like 'Dy
>> FMDDTH Month, "Q"Q ' and expect to get the correct answer. If we
>> start throwing
Brendan Jurd writes:
> For example, you're trying to import a date that is written as "Wed
> 3rd March, Q1 2010". You might give to_date a format string like 'Dy
> FMDDTH Month, "Q"Q ' and expect to get the correct answer. If we
> start throwing an error on the Q field, then users would have
Brendan Jurd wrote:
> > Well, I can easily make it do what you expect, and I don't see many
> > error returns in that area of the code, so I just wrote a patch that
> > does what you would expect rather than throw an error.
> >
> > ? ? ? ?test=> select to_date('2010-1', '-Q');
> > ? ? ? ? ?to_d
On 3 March 2010 14:34, Bruce Momjian wrote:
> Scott Bailey wrote:
>> Tom Lane wrote:
>> > Asher Hoskins writes:
>> >> I can't seem to get to_timestamp() or to_date() to work with quarters,
>> >
>> > The source code says
>> >
>> > * We ignore Q when converting to date because it i
Albe Laurenz wrote:
> > But stop, now i see:
> >
> > test=*# select to_date('2010-02-29', '-MM-DD');
> > to_date
> >
> > 2010-03-01
> > (1 row)
> >
> > So it is maybe a congruously behavior ;-)
>
> Ugh. I thought that to_date was an Oracle compatibility function.
>
> SQL> se
A. Kretschmer *EXTERN*
> > Well, I can easily make it do what you expect, and I don't see many
> > error returns in that area of the code, so I just wrote a patch that
> > does what you would expect rather than throw an error.
>
> Well, that's great and better than an error, thx.
>
> > test=>
In response to Bruce Momjian :
> Well, I can easily make it do what you expect, and I don't see many
> error returns in that area of the code, so I just wrote a patch that
> does what you would expect rather than throw an error.
Well, that's great and better than an error, thx.
> test=> sel
Scott Bailey wrote:
> Tom Lane wrote:
> > Asher Hoskins writes:
> >> I can't seem to get to_timestamp() or to_date() to work with quarters,
> >
> > The source code says
> >
> > * We ignore Q when converting to date because it is not
> > * normative.
> >