BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1

From: "Jeremy Ford" <jeremford(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1
Date: 2009-06-19 01:21:32
Message-ID: 200906190121.n5J1LWv1074541@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers


The following bug has been logged online:

Bug reference: 4862
Logged by: Jeremy Ford
Email address: jeremford(at)gmail(dot)com
PostgreSQL version: 8.4 RC1
Operating system: Fedora 10 i386
Description: different results in to_date() between 8.3.7 & 8.4.RC1
Details:

Running the following query on PG 8.3.7

select
to_char(2009,'9999') as year,
to_char(3,'09') as month,
to_date(to_char(2009,'9999')||to_char(3,'99') ,'YYYYMM') as method1,
to_date(to_char(2009,'9999')||'-'||to_char(3,'09') || '-01','YYYY-MM-DD')
as method2

results in:
year, month, method1, method2
" 2009";" 03";"2009-03-01";"2009-03-01"

Running exactly the same query on PG 8.4.RC1 gives:
year, month, method1, method2
" 2009";" 03";"0200-09-01";"2009-03-01"

PG 8.3.7 “method1” = "2009-03-01"
PG 8.4.RC1 “method1” = "0200-09-01"

Both databases were on the same machine – Fedora 10 – 32bit (GCC 4.3.2).
Server configured for Australian timezone/usage.

I realize I should have slapped a trim() around the to_char(), but thought
it worth noting the difference anyway.

Cheers,
Jeremy.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Page 2009-06-19 07:44:45 Re: BUG #4861: Incorrect log_line_prefix default value in postgresql.conf
Previous Message Milen A. Radev 2009-06-18 23:05:41 Re: BUG #4861: Incorrect log_line_prefix default value in postgresql.conf

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2009-06-19 04:03:42 security checks for largeobjects?
Previous Message Kevin Grittner 2009-06-19 00:03:34 Re: 8.4 open item: copy performance regression?