From 62e57ff040e5d0acd303b94e86fff689effc5957 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 May 2014 09:44:11 -0400 Subject: [PATCH] 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. --- src/backend/utils/adt/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index e2db24520e..22ef4026b7 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);