Re: Abbreviated keys for Numeric - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Abbreviated keys for Numeric
Date
Msg-id 87vbhsbyzh.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Abbreviated keys for Numeric  (Peter Geoghegan <pg@heroku.com>)
Responses Re: Abbreviated keys for Numeric  (Peter Geoghegan <pg@heroku.com>)
Re: Abbreviated keys for Numeric  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
So here's a version 3 patch:

1. #ifdefism is reduced to a minimum by (a) desupporting values of NBASE
other than 10000, and (b) keeping the 32bit code, so that there is now
no longer any question of abbreviation not being used (it always is).
So the only #ifs in the code body (rather than declarations) are to
select which implementation of numeric_abbrev_convert_var to use.

2. Some (but not all) stylistic changes have been made following Peter's
version.

3. Buffer management has been simplified by simply allocating the
maximum needed size upfront (since it's only needed for short varlenas).
The truncation behavior has been removed.

4. Updated oid choice etc.

The substance of the code is unchanged from my original patch.  I didn't
add diagnostic output to numeric_abbrev_abort, see my separate post
about the suggestion of a GUC for that.

--
Andrew (irc:RhodiumToad)


Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: PATCH: numeric timestamp in log_line_prefix
Next
From: Noah Misch
Date:
Subject: Re: Zero-padding and zero-masking fixes for to_char(float)