0

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

McNets
24k11 gold badges51 silver badges90 bronze badges
asked May 24, 2019 at 7:37
1
  • 3
    Change and by a , (comma) Commented May 24, 2019 at 7:41

1 Answer 1

2

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.

answered May 24, 2019 at 8:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.