Re: reducing NUMERIC size for 9.1 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: reducing NUMERIC size for 9.1
Date
Msg-id 10760.1280435829@sss.pgh.pa.us
Whole thread Raw
In response to Re: reducing NUMERIC size for 9.1  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: reducing NUMERIC size for 9.1
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jul 29, 2010 at 1:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> On-disk is what I'm thinking about. �Right now, a NaN's first word is
>> all dscale except the sign bits. �You're proposing to change that
>> but I think it's unnecessary to do so.

> *Where* am I proposing this?

Um, your patch has the comment

!  * If the high bits of n_scale_dscale are NUMERIC_NAN, the two-byte header
!  * format is also used, but the low bits of n_scale_dscale are discarded in
!  * this case.

but now that I look a bit more closely, I don't think that's what the
code is doing.  You've got the NUMERIC_DSCALE and NUMERIC_WEIGHT access
macros testing specifically for NUMERIC_IS_SHORT, not for high-bit-set
which I think is what I was assuming they'd do.  So actually that code
is good as is: a NAN still has the old header format.  It's just the
comment that's wrong.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: multibyte charater set in levenshtein function
Next
From: "Erik Rijkers"
Date:
Subject: Re: patch (for 9.1) string functions