From 44504a8fe96ad76a375c77e5f53e4f897e3ca2f2 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 13 Jul 2023 18:06:07 +0200 Subject: [PATCH 1/2] trivial fixups --- src/backend/utils/adt/jsonfuncs.c | 5 ++--- src/include/utils/jsonfuncs.h | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index 612bbf06a3..764d48505b 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -5691,9 +5691,8 @@ json_get_first_token(text *json, bool throw_error) * Determine how we want to print values of a given type in datum_to_json(b). * * Given the datatype OID, return its JsonTypeCategory, as well as the type's - * output function OID. If the returned category is JSONTYPE_CAST or - * JSOBTYPE_CASTJSON, we return the OID of the type->JSON cast function - * instead. + * output function OID. If the returned category is JSONTYPE_CAST, we return + * the OID of the type->JSON cast function instead. */ void json_categorize_type(Oid typoid, bool is_jsonb, diff --git a/src/include/utils/jsonfuncs.h b/src/include/utils/jsonfuncs.h index 27c2d20610..27a25ba283 100644 --- a/src/include/utils/jsonfuncs.h +++ b/src/include/utils/jsonfuncs.h @@ -63,7 +63,7 @@ extern Jsonb *transform_jsonb_string_values(Jsonb *jsonb, void *action_state, extern text *transform_json_string_values(text *json, void *action_state, JsonTransformStringValuesAction transform_action); -/* Type categories for datum_to_json[b] and friends. */ +/* Type categories returned by json_categorize_type */ typedef enum { JSONTYPE_NULL, /* null, so we didn't bother to identify */ @@ -72,8 +72,8 @@ typedef enum JSONTYPE_DATE, /* we use special formatting for datetimes */ JSONTYPE_TIMESTAMP, JSONTYPE_TIMESTAMPTZ, - JSONTYPE_JSON, /* JSON and JSONB */ - JSONTYPE_JSONB, /* JSONB (for datum_to_jsonb) */ + JSONTYPE_JSON, /* JSON (and JSONB, if not is_jsonb) */ + JSONTYPE_JSONB, /* JSONB (if is_jsonb) */ JSONTYPE_ARRAY, /* array */ JSONTYPE_COMPOSITE, /* composite */ JSONTYPE_CAST, /* something with an explicit cast to JSON */ @@ -81,6 +81,6 @@ typedef enum } JsonTypeCategory; void json_categorize_type(Oid typoid, bool is_jsonb, - JsonTypeCategory *tcategory, Oid *outfuncoid); + JsonTypeCategory *tcategory, Oid *outfuncoid); #endif -- 2.30.2