611{
612 int i;
613 const char *sep;
614
615 Assert(dim < ndims);
616
617 sep = use_line_feeds ? ",\n " : ",";
618
619 appendStringInfoChar(
result,
'[');
620
621 for (i = 1; i <= dims[dim]; i++)
622 {
623 if (i > 1)
624 appendStringInfoString(
result, sep);
625
626 if (dim + 1 == ndims)
627 {
629 outfuncoid, false);
630 (*valcount)++;
631 }
632 else
633 {
634
635
636
637
639 valcount, tcategory, outfuncoid, false);
640 }
641 }
642
643 appendStringInfoChar(
result,
']');
644}
char result[OUT_DOUBLE_BUFFER_SIZE]
static void array_dim_to_json(StringInfo result, int dim, int ndims, int *dims, Datum *vals, bool *nulls, int *valcount, JsonTypeCategory tcategory, Oid outfuncoid, bool use_line_feeds)
static void datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar)