I have a column in table with type character varying here is the query:
update logins
set access_token='l38r8cfjm31b38ye91yjn1956vr3n74tc5sc0btholj0iain77' and uuid='123456789'
where username = 'PWD_2006'
It give me the error:
ERROR: invalid input syntax for type boolean: "l38r8cfjm31b38ye91yjn1956vr3n74tc5sc0btholj0iain77"
LINE 1: update logins set access_token='l38r8cfjm31b38ye91yjn1956vr3... ^
SQL state: 22P02
Character: 32
1 Answer 1
Your query is interpreted as
... SET access_token =
('l38r8cfjm31b38ye91yjn1956vr3n74tc5sc0btholj0iain77'
and uuid='123456789')
That is, AND
is treated as a logical operator, and the string constant is interpreted as a boolean
literal, which causes the error.
Replace AND
with ,
like the comment suggests.
and
by a,
(comma)