Re: WIP: to_char, support for EEEE format

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: to_char, support for EEEE format
Date: 2009-08-10 19:32:52
Message-ID: 162867790908101232x303f6e3axcd0c56bdb4f40c40@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/8/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Brendan Jurd <direvus(at)gmail(dot)com> writes:
>> Here's version 7.
>
> Applied with a couple of corrections: the numeric case wasn't dealing
> with NaNs in the same way as the float cases, and the int8 case was
> converting to float8 which would lose precision.  I made it go through
> numeric instead, which is pretty expensive but I doubt this is worth
> expending extra code on.
>
>                        regards, tom lane
>

It's nice. I am playing with it, and now I found some potential issue.
The parser is maybe too tolerant:

postgres=# select to_char(3.14323,'9.9(aaaaaEEEE');
to_char
----------
3.1e+00
(1 row)

regards
Pavel Stehule

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexey Klyukin 2009-08-10 19:41:28 Re: PL/Perl crash when using threaded perl
Previous Message Kevin Grittner 2009-08-10 19:32:47 Re: Patch for 8.5, transformationHook