From b22391a2ff7bdfeff4438f7a9ab26de3e33fdeff Mon Sep 17 00:00:00 2001 From: Amit Langote Date: Fri, 21 Jul 2023 11:46:56 +0900 Subject: Some refactoring to export json(b) conversion functions This is to export datum_to_json(), datum_to_jsonb(), and jsonb_from_cstring(), though the last one is exported as jsonb_from_text(). A subsequent commit to add new SQL/JSON constructor functions will need them for calling from the executor. Discussion: https://postgr.es/m/20230720160252.ldk7jy6jqclxfxkq%40alvherre.pgsql --- src/include/utils/jsonfuncs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/include/utils/jsonfuncs.h') diff --git a/src/include/utils/jsonfuncs.h b/src/include/utils/jsonfuncs.h index 121dfd5d248..2ad648d1b8b 100644 --- a/src/include/utils/jsonfuncs.h +++ b/src/include/utils/jsonfuncs.h @@ -82,5 +82,10 @@ typedef enum extern void json_categorize_type(Oid typoid, bool is_jsonb, JsonTypeCategory *tcategory, Oid *outfuncoid); +extern Datum datum_to_json(Datum val, JsonTypeCategory tcategory, + Oid outfuncoid); +extern Datum datum_to_jsonb(Datum val, JsonTypeCategory tcategory, + Oid outfuncoid); +extern Datum jsonb_from_text(text *js); #endif -- cgit v1.2.3