This problem posted in OP is resolved. I did some workaround. I copied the required "pg_config*.h" from another machine where PG13 was installed via amazon linux 2 repos.
> I don't believe 9.6 was supported either, but it may have worked "by chance".
I'm not sure whether it worked "by chance" or otherwise, because it looks like Amazon Linux 2 is based on "RHEL 7" as per below:
On Fri, Dec 31, 2021 at 3:32 AM Hasan Marzooq <engr.naqvi@gmail.com> wrote: > > Hi. > I tried "yum install centos-release-scl-rh" before but it gives the below error. > ------ > # yum install centos-release-scl-rh > Loaded plugins: extras_suggestions, langpacks, priorities, update-motd > 213 packages excluded due to repository priority protections > No package centos-release-scl-rh available. > Error: Nothing to do > -------- > > Postgres 9.6 on this machine (Amazon Linux 2) is installed via PGDG repo, so I tried installing Postgres 13 as well, and I can see it has installed but only one more package I need that is "postgresql13-devel.x86_64" which needs another dependency " llvm-toolset-7-clang >= 4.0.1" that is not available from the same repo.
I don't believe 9.6 was supported either, but it may have worked "by chance".
The llvm dependency comes from the JIT functionality, which was added in PostgreSQL 11, so it not being a dependency in an older version than that makes perfect sense.