aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/numeric.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-09-09 20:16:28 +0200
committerPeter Eisentraut <peter@eisentraut.org>2020-09-09 20:16:28 +0200
commit0aa8f764088ea0f36620ae2955fa6c54ec736c46 (patch)
tree875e0b1d49121b331e7471770a8e92b9ef91f37d /src/include/utils/numeric.h
parenta273dcc6fd34c8b6aa290fafa45e516ccd8d907d (diff)
downloadpostgresql-0aa8f764088ea0f36620ae2955fa6c54ec736c46.tar.gz
postgresql-0aa8f764088ea0f36620ae2955fa6c54ec736c46.zip
Expose internal function for converting int64 to numeric
Existing callers had to take complicated detours via DirectFunctionCall1(). This simplifies a lot of code. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu
Diffstat (limited to 'src/include/utils/numeric.h')
-rw-r--r--src/include/utils/numeric.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 0b7d4ba3c4b..2a768b9a04a 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -62,6 +62,8 @@ int32 numeric_maximum_size(int32 typmod);
extern char *numeric_out_sci(Numeric num, int scale);
extern char *numeric_normalize(Numeric num);
+extern Numeric int64_to_numeric(int64 val);
+
extern Numeric numeric_add_opt_error(Numeric num1, Numeric num2,
bool *have_error);
extern Numeric numeric_sub_opt_error(Numeric num1, Numeric num2,