I am marshalling the data as
b, err := json.MarshalJSON(&u3)
if err != nil {
log.Println("error:", err)
}
and then insert
INSERT INTO user_list (userid, listtype, data) VALUES ($1, $2, (array[$3::json]))
The data is written as
{"{\"from\": \"2010-11-12\", \"till\": \"2018-3-10\", \"oieId\": \"1212458454\", \"iType\": \"ird\"}"}
Nothing is helping me prevent those escaping from being written even though the data type is json.RawMessage.
Is there a way to just write as JSON and not cast the $3 to be cast to JSON or just prevent those escapes from being written to jsonb[] type row ?
Any help is appreciated. Thanks