Content-Length: 269255 | pFad | http://github.com/postgrespro/postgres/commit/4ddbb506019aa2015d8fed2d757b2597d2ff22b9

C0 Add JsonValueInitDouble() · postgrespro/postgres@4ddbb50 · GitHub
Skip to content

Commit 4ddbb50

Browse files
author
Nikita Glukhov
committed
Add JsonValueInitDouble()
1 parent bbfbc7f commit 4ddbb50

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/include/utils/json_generic.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,15 @@ JsonValueInitFloat(JsonbValue *jbv, float4 f)
436436
return jbv;
437437
}
438438

439+
static inline JsonbValue *
440+
JsonValueInitDouble(JsonbValue *jbv, float8 f)
441+
{
442+
jbv->type = jbvNumeric;
443+
jbv->val.numeric = DatumGetNumeric(DirectFunctionCall1(
444+
float8_numeric, Float8GetDatum(f)));
445+
return jbv;
446+
}
447+
439448
#define pushJsonbKey(pstate, jbv, key) \
440449
pushJsonbValue(pstate, WJB_KEY, JsonValueInitString(jbv, key))
441450

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/4ddbb506019aa2015d8fed2d757b2597d2ff22b9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy