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

  • 3
    Change and by a , (comma) – McNets May 24 '19 at 7:41

Your query is interpreted as

... SET access_token =
         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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.