summaryrefslogtreecommitdiff
path: root/src/include/utils/jsonapi.h
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2019-09-25 21:53:41 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2019-09-25 22:51:51 +0300
commit6dda292d4df82a9158d1acc93feecf3b84637b59 (patch)
tree4b6ae48e892eb13214c438cc9f6d2fd079eae77e /src/include/utils/jsonapi.h
parent5bc450629b31a0b6986e668056d5bd36792412d2 (diff)
Allow datetime values in JsonbValue
SQL/JSON standard allows manipulation with datetime values. So, it appears to be convinient to allow datetime values to be represented in JsonbValue struct. These datetime values are allowed for temporary representation only. During serialization datetime values are converted into strings. SQL/JSON requires writing timestamps with timezone in the same timezone offset as they were parsed. This is why we allow storage of timezone offset in JsonbValue struct. For the same reason timezone offset argument is added to JsonEncodeDateTime() function. Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov. Revised by me. Comments were adjusted by Liudmila Mantrova. Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com Author: Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Alexander Korotkov, Liudmila Mantrova Reviewed-by: Anastasia Lubennikova, Peter Eisentraut
Diffstat (limited to 'src/include/utils/jsonapi.h')
-rw-r--r--src/include/utils/jsonapi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/utils/jsonapi.h b/src/include/utils/jsonapi.h
index 1c56acca55a..e1dab24d5dd 100644
--- a/src/include/utils/jsonapi.h
+++ b/src/include/utils/jsonapi.h
@@ -161,6 +161,7 @@ extern Jsonb *transform_jsonb_string_values(Jsonb *jsonb, void *action_state,
extern text *transform_json_string_values(text *json, void *action_state,
JsonTransformStringValuesAction transform_action);
-extern char *JsonEncodeDateTime(char *buf, Datum value, Oid typid);
+extern char *JsonEncodeDateTime(char *buf, Datum value, Oid typid,
+ const int *tzp);
#endif /* JSONAPI_H */