Linux with NAT
Quoted 3 lines
"I am using RedHat 7.3 with iptables 1.2.6a, Apache 1.3.27 compiled with PHP 4.2.3 and >mod_perl 1.27, and running postgresql."
your box is trying to access postgresql as a local service through "localhost" Ive actually had simular problems in the past with MySQL, solved it by using "127.0.0.1" instead of "localhost"
AJ