I'm trying to write a Postgres UPDATE query with parameters specified as a list of values, but I'm getting a syntax error. However very similar INSERT query works just fine.
Query giving an error
'update user set (username, firstname, lastname) values($1, $2, $3) where id = 3'
Similar query that works fine
'insert into user (id, position, firstname, lastname) values($1, $2, $3, $4) '
The correct syntax is:
This is called column-list syntax of update statement in PostgreSQL.