Request assistance connecting with Pg::connectdb

From: "Wright, Ryan P" <Ryan(dot)Wright(at)pnl(dot)gov>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Request assistance connecting with Pg::connectdb
Date: 2002-11-21 21:16:23
Message-ID: 1B1080D3ADDF8D4AB59832DE0A02C52A01AE7106@pnlmse06.pnl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am having a heck of a time connecting to my postgres server, and was
hoping some kind soul would advise me on how to proceed.

The problem: Perl script dies with no error message.

Code snippet:

$conn = Pg::connectdb("dbname=testdb host=localhost port=5432 user=postgres
password=test");
print "status = ",$conn->status, "\n";
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;

Code output:

status = 0
Died at ./testscript.pl line 105.

Other relevant information:

- If I specify an incorrect database or username, I get appropriate error
messages from postgres.
- It doesn't matter whether I specify a correct or incorrect password; I get
the same empty error.
- "psql -U postgres -W testdb" works just fine. psql actually works perfect
in every respect. I can connect, grab records, and do everything I should be
able to do.
- Postgres has been started correctly and netstat shows it listening on tcp
port 5432. I accomplished this by changing tcpip_socket = true in
postgresql.conf.
- The machine running the script is the same machine running postgres.
- pg_hba.conf is configured as follows:
local all trust
host all 127.0.0.1 255.255.255.255 trust
host all 192.168.1.12 255.255.255.255 trust

I added the server's remote IP in testing to see if it made a difference. It
did not.

Installation notes:

- System is a Red Hat 7.2 box.
- Postgres v7.2.3 was installed from RPMs yesterday. No prior version of
Postgres has ever been installed on this server.
- Perl version 5.6.0.
- The Postgres Perl extensions were also installed from RPMs. They installed
into /usr/lib/perl5/site_perl/5.6.1/i386_linux. They didn't work from there,
so I moved the files Pg.pm, Pg.so, and autosplit.ix to /usr/lib/perl5/5.6.0
where my cgi-bin.pl resided.

Any advice would be greatly appreciated!

Thank you!

-Ryan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave [Hawk-Systems] 2002-11-21 21:17:15 Re: Selecting distinct records
Previous Message Rod Taylor 2002-11-21 20:23:50 Re: [HACKERS] [GENERAL] Bug with sequence