JsonbValue *res;
} JsonbInState;
-static inline Datum deserialize_json_text(char *json, int len);
+static inline Datum serialize_json_text(char *json, int len);
static size_t checkStringLen(size_t len);
static void jsonb_in_object_start(void *state);
static void jsonb_in_object_end(void *state);
{
char *json = PG_GETARG_CSTRING(0);
- return deserialize_json_text(json, strlen(json));
+ return serialize_json_text(json, strlen(json));
}
/*
else
elog(ERROR, "Unsupported jsonb version number %d", version);
- return deserialize_json_text(str, nbytes);
+ return serialize_json_text(str, nbytes);
}
/*
}
/*
- * deserialize_json_text
+ * serialize_json_text
*
- * turn json text into a jsonb Datum.
+ * Turn json text into a jsonb Datum.
*
- * uses the json parser with hooks to contruct the jsonb.
+ * Uses the json parser with hooks to contruct a jsonb.
*/
static inline Datum
-deserialize_json_text(char *json, int len)
+serialize_json_text(char *json, int len)
{
JsonLexContext *lex;
JsonbInState state;
char *dataProper;
/*
- * Enum members should be freely OR'ed with JB_FLAG_ARRAY/JB_FLAG_OBJECT
- * with possibility of decoding.
+ * Enum members are OR'ed with JB_FLAG_ARRAY/JB_FLAG_OBJECT.
*
* See optimization in JsonbIteratorNext()
*/