diff options
author | Peter Eisentraut | 2020-09-09 18:16:28 +0000 |
---|---|---|
committer | Peter Eisentraut | 2020-09-09 18:16:28 +0000 |
commit | 0aa8f764088ea0f36620ae2955fa6c54ec736c46 (patch) | |
tree | 875e0b1d49121b331e7471770a8e92b9ef91f37d /contrib/jsonb_plperl/jsonb_plperl.c | |
parent | a273dcc6fd34c8b6aa290fafa45e516ccd8d907d (diff) |
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 <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'contrib/jsonb_plperl/jsonb_plperl.c')
-rw-r--r-- | contrib/jsonb_plperl/jsonb_plperl.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/contrib/jsonb_plperl/jsonb_plperl.c b/contrib/jsonb_plperl/jsonb_plperl.c index b81ba54b809..22e90afe1b6 100644 --- a/contrib/jsonb_plperl/jsonb_plperl.c +++ b/contrib/jsonb_plperl/jsonb_plperl.c @@ -216,9 +216,7 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem) IV ival = SvIV(in); out.type = jbvNumeric; - out.val.numeric = - DatumGetNumeric(DirectFunctionCall1(int8_numeric, - Int64GetDatum((int64) ival))); + out.val.numeric = int64_to_numeric(ival); } else if (SvNOK(in)) { |