Reputation: 540
I want to update a row in my table which contains a user-defined type column. So, i did a query for this :
update test set identifiers = identifiers + {id : 'test1', cat_name : 'test1'} where id = 1;
Here is my table test :
CREATE TABLE public.test (
id int PRIMARY KEY,
identifiers frozen<identifier>
)
Thank you in advance
Upvotes: 0
Views: 1004
Reputation: 21
Put Squire brackets before flower brackets. It will add new row to the existing one. As shown below.
update test set identifiers = identifiers +[{id :'test1',cat_name:'test1'}] where id = 1
Upvotes: 2