Hay un error: ERROR: column "logran" does not exist LINE 25: ...apublicacion >= '2019-05-26 06:03:29' ) AND n.idnota =logran ^