Thursday, 20 April 2017

postgre column value not updating properly?

I have a data in the below format:

var data = [{a:'1',b:'2',c:'3'}]

I have to update one of the column in my table with this data:

query:

pgFormat("update user set list = %L WHERE userId ='1'",data);

Consoled Query

"update user set list = '{a:'1',b:'2',c:'3'}::jsonb' WHERE userId ='1'"

Requirement

I have seen many solutions like upgrading postgre to support jsonob , but i don't want the json to be inserted.

I want the data to be inserted as string with that array symbol.

eg: [{a:'1',b:'2',c:'3'}] ->> thsi data to be updated to that column



via midhun k

No comments:

Post a Comment