use the php-command: phpinfo();
to check that your php-module contains postgres support.
Well, that would be a nice exercise, but you do not really need to do that:
The error-message
call to unsupported or undefined function pg_connect()
actually says that your php doesn't have postgres support.
So why don't start downloading the php-source, typing:
tar xvfz ...
./configure --with-apxs --with-pgsql
make
make install
If you're lucky you wont have to recompile apache. Today I had the same problem and I was succesfull only by replacing libphp4.so in the directory /usr/lib/apache. Actually make install did that. Maybe you want to backup your old libphp4.so. Restarting Apache should do the job!
Have fun,
Rik