Thread: pgsql: Adjust src/include/utils/jsonapi.h so it's not backend-only.

pgsql: Adjust src/include/utils/jsonapi.h so it's not backend-only.

From
Robert Haas
Date:
Adjust src/include/utils/jsonapi.h so it's not backend-only.

The major change here is that we no longer include jsonb.h into
jsonapi.h. The reason that was necessary is that jsonapi.h included
several prototypes functions in jsonfuncs.c that depend on the Jsonb
type. Move those prototypes to a new header, jsonfuncs.h, and include
it where needed.

The other change is that JsonEncodeDateTime is now declared in
json.h rather than jsonapi.h.

Taken together, these steps eliminate all dependencies of jsonapi.h
on backend-only data types and header files, so that it can
potentially be included in frontend code.

Branch
------
master

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

Modified Files
--------------
src/backend/tsearch/to_tsany.c     |  1 +
src/backend/tsearch/wparser.c      |  1 +
src/backend/utils/adt/jsonb_util.c |  1 +
src/backend/utils/adt/jsonfuncs.c  |  1 +
src/include/utils/json.h           |  2 ++
src/include/utils/jsonapi.h        | 33 -------------------------
src/include/utils/jsonfuncs.h      | 49 ++++++++++++++++++++++++++++++++++++++
7 files changed, 55 insertions(+), 33 deletions(-)