I have a Mulesoft flow that is inserting data into a PostgreSQL table. The data is of type JSON. Here is a copy of the data: (I grabbed this from the debugger as it is about to call the insert command)
[
{
"id": {
"type": "MyType",
"value": "MyValue"
}
}
]
When I try and insert it into a JSON column I get this error
"ERROR: invalid input syntax for type json
Detail: Token "id" is invalid.
Where: JSON data, line 1: [{id..."
So I decided to insert it into a TEXT column and this is what it looks like
[{id={type=MyType, value=MyValue}}]
Notice the addition of an '=' after 'id' instead of the ':' and the removal of the quotes.
I am not sure why this is happening. Basically I just need to insert the JSON data into a JSON column.
Thanks