aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/jsonapi.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-05-09 11:32:28 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-05-09 12:46:21 +0300
commitd3c72e23df6ef1fde8122db589d12d49c8495535 (patch)
tree801f175510fff7f438e5c4abc3bca5c81dba70d1 /src/include/utils/jsonapi.h
parent14d309cc55d88b73d4c9d1fa51b535ae491405fd (diff)
downloadpostgresql-d3c72e23df6ef1fde8122db589d12d49c8495535.tar.gz
postgresql-d3c72e23df6ef1fde8122db589d12d49c8495535.zip
Avoid some pnstrdup()s when constructing jsonb
This speeds up text to jsonb parsing and hstore to jsonb conversions somewhat.
Diffstat (limited to 'src/include/utils/jsonapi.h')
-rw-r--r--src/include/utils/jsonapi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/utils/jsonapi.h b/src/include/utils/jsonapi.h
index 889364fb30e..df057121a11 100644
--- a/src/include/utils/jsonapi.h
+++ b/src/include/utils/jsonapi.h
@@ -73,6 +73,10 @@ typedef void (*json_scalar_action) (void *state, char *token, JsonTokenType toke
* point, Likewise, semstate can be NULL. Using an all-NULL structure amounts
* to doing a pure parse with no side-effects, and is therefore exactly
* what the json input routines do.
+ *
+ * The 'fname' and 'token' strings passed to these actions are palloc'd.
+ * They are not free'd or used further by the parser, so the action function
+ * is free to do what it wishes with them.
*/
typedef struct JsonSemAction
{