pgsql: Centralize json and jsonb handling of datetime types - Mailing list pgsql-committers

Centralize json and jsonb handling of datetime types

The creates a single function JsonEncodeDateTime which will format these
data types in an efficient and consistent manner. This will be all the
more important when we come to jsonpath so we don't have to implement yet
more code doing the same thing in two more places.

This also extends the code to handle time and timetz types which were
not previously handled specially. This requires exposing the time2tm and
timetz2tm functions.

Patch from Nikita Glukhov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cc4feded0a31d2b732d4ea68613115cb720e624e

Modified Files
--------------
src/backend/utils/adt/date.c  |   6 +--
src/backend/utils/adt/json.c  | 122 ++++++++++++++++++++++++++++++++----------
src/backend/utils/adt/jsonb.c |  70 ++++--------------------
src/include/utils/date.h      |   4 +-
src/include/utils/jsonapi.h   |   2 +
5 files changed, 109 insertions(+), 95 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Remove useless use of bit-masking macros
Next
From: Amit Langote
Date:
Subject: Re: pgsql: Centralize json and jsonb handling of datetime types