- Jsonb *input_jsonb_a = PG_GETARG_JSONB(0);
- ArrayType *input_array = PG_GETARG_ARRAYTYPE_P(1);
- Jsonb *input_jsonb_b = PG_GETARG_JSONB(2);
+ Jsonb *input_jsonb_a = PG_GETARG_JSONB(0);
+ ArrayType *input_array = PG_GETARG_ARRAYTYPE_P(1);
+ Jsonb *input_jsonb_b = PG_GETARG_JSONB(2);
+
+ /* pointer to return jsonb data */
+ Jsonb *return_jsonb = NULL;
+
+ return_jsonb = jsonbModifyPath(input_jsonb_a, input_array, input_jsonb_b);
+
+ PG_FREE_IF_COPY(input_jsonb_a, 0);
+ PG_FREE_IF_COPY(input_array, 1);
+ PG_FREE_IF_COPY(input_jsonb_b, 2);
+
+ PG_RETURN_JSONB(return_jsonb);
+}
+
+
+Datum jsonb_append_path(PG_FUNCTION_ARGS);
+
+PG_FUNCTION_INFO_V1(jsonb_append_path);
+
+/*
+ * Test
+ * jsonb, text[], jsonb -> jsonb
+ *
+ */
+Datum
+jsonb_append_path(PG_FUNCTION_ARGS)
+{
+ /* pointers to incoming jsonb and text[] data */
+ Jsonb *input_jsonb_a = PG_GETARG_JSONB(0);
+ ArrayType *input_array = PG_GETARG_ARRAYTYPE_P(1);
+ Jsonb *input_jsonb_b = PG_GETARG_JSONB(2);