aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/jsonfuncs.h
diff options
context:
space:
mode:
authorAmit Langote <amitlan@postgresql.org>2023-07-21 11:46:56 +0900
committerAmit Langote <amitlan@postgresql.org>2023-07-26 17:06:03 +0900
commitb22391a2ff7bdfeff4438f7a9ab26de3e33fdeff (patch)
treed19d03ff3d672900360a84cae910419d1d4eeb30 /src/include/utils/jsonfuncs.h
parentbd88404d3cda53810e0b0144713c4b1a1dd965a8 (diff)
downloadpostgresql-b22391a2ff7bdfeff4438f7a9ab26de3e33fdeff.tar.gz
postgresql-b22391a2ff7bdfeff4438f7a9ab26de3e33fdeff.zip
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
Diffstat (limited to 'src/include/utils/jsonfuncs.h')
-rw-r--r--src/include/utils/jsonfuncs.h5
1 files changed, 5 insertions, 0 deletions
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