in reply to Postgres + Perl + Ubuntu
Connecting via a unix socket vs connecting via the local interface (127.0.0.1) vs connection via a non-local interface can make a difference. Check to which one the server listens, and check the user permissions to see which user can be used on which interface. Adjust as needed.