 +{
 +	WRITE_NODE_TYPE("A_CONST");
 +
++	appendStringInfo(str, "\"type\": %d, ", node->val.type);
 +	appendStringInfoString(str, "\"val\": ");
 +	_outValue(str, &(node->val));
 +	appendStringInfoString(str, ", ");

index 0000000..eaded0f
--- /dev/null
+++ b/src/backend/nodes/outfuncs_json.c
@@ -0,0 +1,1035 @@
+/*-------------------------------------------------------------------------
+ *
+ * outfuncs_json.c

+			break;
+		case T_BitString:
+			/* internal representation already has leading 'b' */
+			_outToken(str, value->val.str);
+			break;
+		case T_Null:
+			/* this is seen only within A_Const, not in transformed trees */
