I am trying to insert timestamp into json data into a column called ‘conversations’ of type "jsonb"
this is what I want the data to look like-
{
"sender": "John",
"message": "Issue",
"msgAt": "2022-11-11"}
Below is my attempt at the above,which is not the correct format for the function NOW()
INSERT INTO ticket_data(conversations) VALUES('{"sender":"John","message":"Issue","msgAt":NOW()}');
Any help is appreciated!
2
Answers
or use parameter.
From JSON functions Table 9.47. JSON Creation Functions.
Changed
now()
tocurrent_date
as that was what you wanted to end up with.