Re: WIP: to_char, support for EEEE format

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: to_char, support for EEEE format
Date: 2009-07-24 00:05:56
Message-ID: 4A68FAE4.50206@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Brendan Jurd escreveu:
> 2009/4/26 Brendan Jurd <direvus(at)gmail(dot)com>:
>> I've done some work updating Pavel's sci notation patch for to_char().
>
> That patch again, now with a couple of minor tweaks to make it apply
> cleanly against the current HEAD.
>
Here is my review. The patch applied without problems. The docs and regression
tests are included. Both of them worked as expected. Also, you included a fix
in RN format, do it in another patch.

The behavior is not the same as Oracle. Oracle accepts an invalid scientific
notation '999.9EEEE'. Will we support it too? I think so.

euler=# SELECT to_char(1234.56789, '999.9EEEE');
ERRO: invalid format for scientific notation
DETALHE: "EEEE" requires exactly one digit before the decimal point.
DICA: For example, "9.999EEEE" is a valid format.

TO_CHAR(1234.56789,'999.9EEEE')
-------------------------------
1.2E+03

1 rows selected

The '9.999eeee' format error message is misleading.

euler=# select to_char(123, '9.999eeee');
ERRO: cannot use "EEEE" twice

You could include an example in manual too. You could add the two failing
cases above in regression tests too.

--
Euler Taveira de Oliveira
http://www.timbira.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-07-24 00:32:03 Re: When is a record NULL?
Previous Message Tom Lane 2009-07-23 23:22:37 Re: When is a record NULL?