Is there a way to set variable in UPDATE statement in PostgreSQL (plpgsql)?
Assuming the update only affects one row:

DECLARE
c INTEGER;
UPDATE table SET col = col + 1 WHERE id = 1
  RETURNING col INTO c;


Reference.