340 Assert(!(key_scalar && is_null));
344 appendStringInfoString(result,
"null");
354 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
355 errmsg(
"key value must be scalar, not array, composite, or json")));
366 outputstr = DatumGetBool(val) ?
"true" :
"false";
368 escape_json(result, outputstr);
370 appendStringInfoString(result, outputstr);
373 outputstr = OidOutputFunctionCall(outfuncoid, val);
379 if (!key_scalar && IsValidJsonNumber(outputstr, strlen(outputstr)))
380 appendStringInfoString(result, outputstr);
382 escape_json(result, outputstr);
387 char buf[MAXDATELEN + 1];
390 appendStringInfo(result,
"\"%s\"", buf);
395 char buf[MAXDATELEN + 1];
398 appendStringInfo(result,
"\"%s\"", buf);
403 char buf[MAXDATELEN + 1];
406 appendStringInfo(result,
"\"%s\"", buf);
411 outputstr = OidOutputFunctionCall(outfuncoid, val);
412 appendStringInfoString(result, outputstr);
417 jsontext = DatumGetTextPP(OidFunctionCall1(outfuncoid, val));
419 appendStringInfoString(result, outputstr);
424 outputstr = OidOutputFunctionCall(outfuncoid, val);
425 escape_json(result, outputstr);
static char * postgis_JsonEncodeDateTime(char *buf, Datum value, Oid typid)
static void composite_to_json(Datum composite, StringInfo result, bool use_line_feeds)
static void array_to_json_internal(Datum array, StringInfo result, bool use_line_feeds)
char * text_to_cstring(const text *textptr)