PostgreSQL JSON update not working

  • Goal: Update row with json object in postgresql table

  • Details: Whenever I try to include a json object in my insert query to my postgresql table it always gives me an error saying

update "pricinggrouptable" set "updatequeue" = $1 where "id" = $2 returning * - invalid input syntax for type json

The updatequeue column in my table is of a json type. And this is the object that I am trying to insert:

{"newName": {{editPricingGroupName.value}}, "newValue": {{editMarginValueInput.value}} }

This is the preview of the query:
Screenshot 2024-04-23 at 11.28.11 AM

Hi @jeevenugo,

Try wrapping the JSON in quotes instead of inserting the object. JSON looks like an object, but it's a string.

'{"newName": {{editPricingGroupName.value}}, "newValue": {{editMarginValueInput.value}} }'

Nope still giving me issues

Hello @jeevenugo!

In your query, could you try changing the Changeset from 'Key value pairs' to 'Object'? Let me know if that works or if there's a different error!