If you want to use pgsql, you might be better served by using another LAMP stack. If you managed to get pgsql integrated into XAMPP's environment (including modifying scripts), pgsql would have to be re-integrated each time a new XAMPP version is released. Also, pgsql would have to be recompiled each time a new version of it came available.
This would not be worth the effort unless you built other scripts to automate the pgsql re-integration process. This is possible to do because it's all open source, but is it really supportable and worth your time? That's a question only you can answer.
Here is a pgsql "LAMP" stack, otherwise known as "LAPP":
If I were required
to use XAMPP and pgsql, I would simply
install and maintain them separately. The web pages can choose which database to connect to without requiring that pgsql be integrated into XAMPPs environment. I do not see any disadvantage to this approach.
What is the reason you need (or want) to use pgsql?