Add overflow test in function numeric_exp.

Started by Yang Xiaoover 7 years ago2 messageshackers
Jump to latest
#1Yang Xiao
YangX92@hotmail.com

Hi,

The attachment is the proposal patch for function numeric_exp in
src/backend/utils/adt/numeric.c.

Young

Attachments:

0001-Add-overflow-test-in-function-numeric_exp.patchtext/plain; name=0001-Add-overflow-test-in-function-numeric_exp.patchDownload+7-6
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Yang Xiao (#1)
Re: Add overflow test in function numeric_exp.

Yang Xiao <YangX92@hotmail.com> writes:

The attachment is the proposal patch for function numeric_exp in
src/backend/utils/adt/numeric.c.

Why do we need this? numeric_exp() already detects result overflow.

regression=# select numeric_exp(10000);
ERROR: value overflows numeric format

regards, tom lane