Hello !
When I try to insert an object with an array, I see that the query sent to Postgre is not valid.
INSERT INTO ... '["tag1", "tag2"]' is generated instead of INSERT INTO ... '{"tag1", "tag2"}'
Do you have any idea what went wrong ?
Thank's :)
That looks like JSON, you probably need to add ,array tag to the struct field.
I've added sql:",array" to the field of my struct, but the error is still there.
Okay, now it is time to create a small program that reproduces the problem.
Same here trying to find the reason, seems it ignores sql:",array" somehow
Can you please re-open the issue @vmihailenco ?
Here's a small program that reproduces the problem.
https://github.com/gmolveau/go-pg-bug
You should fix tags in you example json:"tags,omitempty" sql:",array".
Oh... well... that was it ¯_(ツ)_/¯ Thank's for your help !
Most helpful comment
You should fix tags in you example
json:"tags,omitempty" sql:",array".