From: Tom Lane Date: Fri, 9 May 2014 13:44:11 +0000 (-0400) Subject: Teach add_json() that jsonb is of TYPCATEGORY_JSON. X-Git-Tag: REL9_4_BETA1~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62e57ff040e5d0acd303b94e86fff689effc5957;p=thirdparty%2Fpostgresql.git Teach add_json() that jsonb is of TYPCATEGORY_JSON. This code really needs to be refactored so that there aren't so many copies that can diverge. Not to mention that this whole approach is probably wrong. But for the moment I'll just stick my finger in the dike. Per report from Michael Paquier. --- diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index e2db24520eb..22ef4026b7e 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -1562,7 +1562,7 @@ add_json(Datum val, bool is_null, StringInfo result, Oid val_type, bool key_scal tcategory = TYPCATEGORY_ARRAY; else if (val_type == RECORDOID) tcategory = TYPCATEGORY_COMPOSITE; - else if (val_type == JSONOID) + else if (val_type == JSONOID || val_type == JSONBOID) tcategory = TYPCATEGORY_JSON; else tcategory = TypeCategory(val_type);