556{
557 int i;
558 const char *sep;
559
560 Assert(dim < ndims);
561
562 sep = use_line_feeds ? ",\n " : ",";
563
564 appendStringInfoChar(result, '[');
565
566 for (i = 1; i <= dims[dim]; i++)
567 {
568 if (i > 1)
569 appendStringInfoString(result, sep);
570
571 if (dim + 1 == ndims)
572 {
573 datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
574 outfuncoid, false);
575 (*valcount)++;
576 }
577 else
578 {
579
580
581
582
584 valcount, tcategory, outfuncoid, false);
585 }
586 }
587
588 appendStringInfoChar(result, ']');
589}
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)