pgsql: Move some code from jsonapi.c to jsonfuncs.c.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move some code from jsonapi.c to jsonfuncs.c.
Date: 2020-01-27 16:24:29
Message-ID: E1iw7Bd-00061o-At@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move some code from jsonapi.c to jsonfuncs.c.

Specifically, move those functions that depend on ereport()
from jsonapi.c to jsonfuncs.c, in preparation for allowing
jsonapi.c to be used from frontend code.

A few cases where elog(ERROR, ...) is used for can't-happen
conditions are left alone; we can handle those in some other
way in frontend code.

Reviewed by Mark Dilger and Andrew Dunstan.

Discussion: http://postgr.es/m/CA+TgmoYfOXhd27MUDGioVh6QtpD0C1K-f6ObSA10AWiHBAL5bA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/73ce2a03f30b52d6bfb26bc28f1e3e1aa1637577

Modified Files
--------------
src/backend/utils/adt/json.c | 2 +-
src/backend/utils/adt/jsonapi.c | 127 +-------------------------------------
src/backend/utils/adt/jsonb.c | 2 +-
src/backend/utils/adt/jsonfuncs.c | 126 +++++++++++++++++++++++++++++++++++++
src/include/utils/jsonapi.h | 15 +----
src/include/utils/jsonfuncs.h | 9 +++
6 files changed, 140 insertions(+), 141 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-01-27 23:46:34 pgsql: Apply project best practices to switches over enum values.
Previous Message Robert Haas 2020-01-27 16:19:42 pgsql: Adjust pg_parse_json() so that it does not directly ereport().