JsonbValue key,
val;
- key.estSize = sizeof(JEntry);
key.type = jbvString;
key.val.string.len = HS_KEYLEN(entries, i);
key.val.string.val = pnstrdup(HS_KEY(entries, base, i), key.val.string.len);
- key.estSize += key.val.string.len;
res = pushJsonbValue(&state, WJB_KEY, &key);
if (HS_VALISNULL(entries, i))
{
- val.estSize = sizeof(JEntry);
val.type = jbvNull;
}
else
{
- val.estSize = sizeof(JEntry);
val.type = jbvString;
val.val.string.len = HS_VALLEN(entries, i);
val.val.string.val = pnstrdup(HS_VAL(entries, base, i), val.val.string.len);
- val.estSize += val.val.string.len;
}
res = pushJsonbValue(&state, WJB_VALUE, &val);
}
JsonbValue key,
val;
- key.estSize = sizeof(JEntry);
key.type = jbvString;
key.val.string.len = HS_KEYLEN(entries, i);
key.val.string.val = pnstrdup(HS_KEY(entries, base, i), key.val.string.len);
- key.estSize += key.val.string.len;
res = pushJsonbValue(&state, WJB_KEY, &key);
- val.estSize = sizeof(JEntry);
-
if (HS_VALISNULL(entries, i))
{
val.type = jbvNull;
val.val.numeric = DatumGetNumeric(
DirectFunctionCall3(numeric_in, CStringGetDatum(tmp.data), 0, -1));
- val.estSize += VARSIZE_ANY(val.val.numeric) +sizeof(JEntry);
}
else
{
- val.estSize = sizeof(JEntry);
val.type = jbvString;
val.val.string.len = HS_VALLEN(entries, i);
val.val.string.val = pnstrdup(HS_VAL(entries, base, i), val.val.string.len);
- val.estSize += val.val.string.len;
}
}
res = pushJsonbValue(&state, WJB_VALUE, &val);