pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Unify JSON categorize type API and export for external use
Date: Thu, 20 Jul 2023 08:16:29 +0000
Message-ID: <E1qMOpo-000Puu-MB@gemulon.postgresql.org> (raw)

Unify JSON categorize type API and export for external use

This essentially removes the JsonbTypeCategory enum and
jsonb_categorize_type() and integrates any jsonb-specific logic that
was in jsonb_categorize_type() into json_categorize_type(), now
moved to jsonfuncs.c.  The remaining JsonTypeCategory enum and
json_categorize_type() cover the needs of the callers in both json.c
and jsonb.c.  json_categorize_type() has grown a new parameter named
is_jsonb for callers to engage the jsonb-specific behavior of
json_categorize_type().

One notable change in the now exported API of json_categorize_type()
is that it now always returns *outfuncoid even though a caller may
have no need currently to see one.

This is in preparation of later commits to implement additional
SQL/JSON functions.

Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3c152a27b06313fe27bd47079658f928e291986b

Modified Files
--------------
src/backend/utils/adt/json.c      | 137 ++-------------------
src/backend/utils/adt/jsonb.c     | 245 +++++++++-----------------------------
src/backend/utils/adt/jsonfuncs.c | 111 +++++++++++++++++
src/include/utils/jsonfuncs.h     |  20 ++++
src/tools/pgindent/typedefs.list  |   1 -
5 files changed, 199 insertions(+), 315 deletions(-)



Message-ID: <E1qMOpo-000Puu-MB@gemulon.postgresql.org>
Permalink:  ../E1qMOpo-000Puu-MB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qMOpo-000Puu-MB@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Unify JSON categorize type API and export for external use
  In-Reply-To: <E1qMOpo-000Puu-MB@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox