Skip to content

Commit

Permalink
Add non-decimal integer support to type numeric.
Browse files Browse the repository at this point in the history
This enhances the numeric type input function, adding support for
hexadecimal, octal, and binary integers of any size, up to the limits
of the numeric type.

Since 6fcda9a, such non-decimal integers have been accepted by the
parser as integer literals and passed through to numeric_in(). This
commit gives numeric_in() the ability to handle them.

While at it, simplify the handling of NaN and infinities, reducing the
number of calls to pg_strncasecmp(), and arrange for pg_strncasecmp()
to not be called at all for regular numbers. This gives a significant
performance improvement for decimal inputs, more than offsetting the
small performance hit of checking for non-decimal input.

Discussion: https://postgr.es/m/CAEZATCV8XShnmT9HZy25C%2Bo78CVOFmUN5EM9FRAZ5xvYTggPMg%40mail.gmail.com
  • Loading branch information
deanrasheed committed Jan 23, 2023
1 parent 62e1e28 commit 6dfacbf
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 95 deletions.
Loading

0 comments on commit 6dfacbf

Please sign in to comment.