7.0.3 to_char() (was: [BUGS] Bugs in to_char function)

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: 7.0.3 to_char() (was: [BUGS] Bugs in to_char function)
Date: 2000-10-18 13:24:06
Message-ID: Pine.LNX.3.96.1001018151443.28292J-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches


On Tue, 17 Oct 2000, Tom Lane wrote:

> "Tom Rogers" <trogers3(at)creigh(dot)com> writes:
> > [to_char] gives the correct meridian value for all AM times but incorrectly
> > returns an AM meridian for PM times between 12:00 PM and 1:50:59 PM.
>
> I believe this is a known bug in the 7.0 implementation of to_char, and
> is long since fixed in development sources. Karel Zak is the author of
> to_char and would know for sure. Karel, does it make sense to
> back-patch a quick fix for this into REL7_0_PATCHES for the upcoming
> 7.0.3 release? If so, could you provide a patch?

Well, a quick fix is a quick fix. The patch for REL7_0_PATCHES is in the
attache. Note, it must be apply in src/backend/utils/adt, because it is not
created as --recursive.

Karel

PS. 7.1 contains more changes for to_char/to_timestamp, this fix PM/AM
only ....

test=# select to_char(t, 'HH24 hours = HH12 p.m.') from day;
to_char
--------------------
01 hours = 01 a.m.
02 hours = 02 a.m.
03 hours = 03 a.m.
04 hours = 04 a.m.
05 hours = 05 a.m.
06 hours = 06 a.m.
07 hours = 07 a.m.
08 hours = 08 a.m.
09 hours = 09 a.m.
10 hours = 10 a.m.
11 hours = 11 a.m.
12 hours = 12 p.m.
13 hours = 01 p.m.
14 hours = 02 p.m.
15 hours = 03 p.m.
16 hours = 04 p.m.
17 hours = 05 p.m.
18 hours = 06 p.m.
19 hours = 07 p.m.
20 hours = 08 p.m.
21 hours = 09 p.m.
22 hours = 10 p.m.
23 hours = 11 p.m.
00 hours = 12 a.m.
(24 rows)

Right?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-10-18 15:16:52 Re: The Data Base System is in recovery mode
Previous Message Palle Girgensohn 2000-10-18 10:46:58 Re: The Data Base System is in recovery mode

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Hollomon 2000-10-18 15:11:28 DROP TABLE/VIEW patch
Previous Message Timaran Ricardo 2000-10-18 11:36:50 Re: Documentation about compiler Postgres