Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1 - Mailing list pgsql-bugs

From Jeremy Ford
Subject Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1
Date
Msg-id 9b8ea02b0906232208n2bf81918ob3530a7c2ae04a5f@mail.gmail.com
Whole thread Raw
In response to Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I've just compiled and run the 8.4.RC2 code. For both of the following queries I get "0009-03-01"

SELECT to_date(' 2009 03', '  YYYY MM') as extraspace; --returns "0009-03-01"
SELECT to_date('2009 03', ' YYYY MM') as bogusspace; --returns "0009-03-01"

Was it the intention to imitate Oracle behavior for these two cases in this release? (8.3.7 returns "0009-03-01" as well)

The others in that set of queries all work as expected ("2009-03-01"):
SELECT to_date(' 2009 03', 'YYYYMM') as nospace; --returns "2009-03-01"
SELECT to_date(' 2009 03', 'YYYY MM') as monthspace; --returns "2009-03-01"
SELECT to_date(' 2009 03', ' YYYY MM') as bothspaces; --returns "2009-03-01"

cheers, jeremy.

On Tue, Jun 23, 2009 at 3:55 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Brendan Jurd <direvus@gmail.com> writes:
> Here's a one-line patch to fix a regression in the new from_char code
> I introduced into 8.4.

> Versions <= 8.3 skipped over any whitespace immediately preceding any
> integer field, and this behaviour was lost in HEAD when my from_char
> patch was committed back in September '08 [1].

Applied along with some regression test additions.  Thanks for the
quick response.

                       regards, tom lane

pgsql-bugs by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: GetTokenInformation() and FreeSid() at port/exec.c
Next
From: Роман Галеев
Date:
Subject: Re: BUG #4874: vacuum doest work