Re: FM suffix in to_char Y/YY/YYY still screwy

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: FM suffix in to_char Y/YY/YYY still screwy
Date: 2010-04-08 03:56:33
Message-ID: z2x37ed240d1004072056t9d9da28n446ff7692ea7b7a4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8 April 2010 06:46, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Not a lot of zero suppression happening there :-(.
>
> I believe the correct fix is to reduce the year mod 100 (or 10 or 1000)
> before feeding it to snprintf, rather than playing games with printing
> only part of the result string as the original and current code try to
> do.

I think you're right. FM should behave as advertised, even for years.

Cheers,
BJ

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2010-04-08 05:11:00 A maze of twisty mailing lists all the same
Previous Message Dhiraj Lohiya 2010-04-08 03:35:11 Re: Enhancing phonetic search support for more languages - GSoC 2010