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