Re: [PATCH] Don't truncate integer part in to_char for 'FM99.'

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Don't truncate integer part in to_char for 'FM99.'
Date: 2011-09-07 20:30:33
Message-ID: CABRT9RD4gp6RkbDjy8wLq1o6p0fsmUpmn2DGOsKvNhGptyGssw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 7, 2011 at 21:37, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Hmm.  I agree that this is a bug, but the proposed fix seems like a bit
> of a kluge. Wouldn't it be better to make get_last_relevant_decnum
> honor its contract, that is not delete any relevant digits?

You're right, it was a kludge.

Here's an improved version. I need to take a NUMProc* argument to do
that right, because that's how it knows how many '0's to keep from the
format.

What do you think?

Regards,
Marti

Attachment Content-Type Size
0001-Don-t-truncate-integer-part-in-to_char-for-FM99.patch text/x-patch 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-09-07 20:48:31 Re: [PATCH] Don't truncate integer part in to_char for 'FM99.'
Previous Message Robert Haas 2011-09-07 20:30:13 Re: [PATCH] Log crashed backend's query (activity string)