Hi there, I'm having a problem with updating value...
# off-topic
d
Hi there, I'm having a problem with updating values inside my table. It errors,
{"error":{"code":400,"message":"operator does not exist: text = integer","requestId":""}}
Is this an issue that anyone else has?
g
Believe your are trying to access a number column with text or the opposite.
d
I don't have any number columns in the table though
these are the columns that are in the table
here's the query that leads to the error
Copy code
sql
update public.deals set (id,name,platform,link,time,uuid) = (select id,name,platform,link,time,uuid from json_populate_record(null::public.deals, '{\"id\":\"000000000000000172\",\"name\":\"test\",\"platform\":\"test\",\"link\":\"test\",\"time\":\"test\",\"uuid\":\"0e8dc0a1-eb82-42af-a114-c95b310689a2\"}')) where id = 172;
g
I'm going to guess that id string is getting converted to a number in the process somewhere
d
That's what i'm thinking too
g
Your where id = 172, is an int. You will have to match your string exactly (all the 0's included). Seems like a painful way to do an ID
d
Okay, I will get that changed, thanks for the help.