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

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Adjust src/include/utils/jsonapi.h so it's not backend-only.
Date: 2020-01-24 18:08:49
Message-ID: E1iv3Nx-0001tg-44@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2020-01-24 18:22:55 pgsql: Split JSON lexer/parser from 'json' data type support.
Previous Message Fujii Masao 2020-01-24 11:44:32 pgsql: Add pg_file_sync() to adminpack extension.