I have tried your suggestion, but the error is still present.
I get below stack trace when I run 'yum update' or 'yum install'
I have tried few more things 1. If I specify --nogpgcheck in yum install or remove pgdg-redhat-all.repo, the error goes away. 2. I have also specified their respective gpgkeys file.
I don't think it's an issue with yum or the system at this point, as we can reproduce it on other systems.