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