Move some code from jsonapi.c to jsonfuncs.c.
Robert Haas <rhaas@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/jsonapi.c | modified | +2 −125 |
| src/backend/utils/adt/jsonb.c | modified | +1 −1 |
| src/backend/utils/adt/json.c | modified | +1 −1 |
| src/backend/utils/adt/jsonfuncs.c | modified | +126 −0 |
| src/include/utils/jsonapi.h | modified | +1 −14 |
| src/include/utils/jsonfuncs.h | modified | +9 −0 |
Discussion
- making the backend's json parser work in frontend code 101 messages · 2020-01-15 → 2020-01-30