Hay un error: ERROR: column "rafael" does not exist LINE 25: WHERE n.idnota =rafael ^