From: | Kate Collins <klcollins(at)wsicorp(dot)com> |
---|---|
To: | kris(at)grinz(dot)com |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: prob with PERL/Postgres |
Date: | 2001-08-06 20:02:50 |
Message-ID: | 3B6EF7EA.3B5DD354@wsicorp.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I use the Perl DBI module to connect to a postgres data base on the local
system. I don't specify the host name. This is the syntax I use to connect to
the data base:
use DBI;
$dbname = "foo";
$connstr = "dbi:Pg:dbname=$dbname";
$dbh = DBI->connect($connstr);
Kristopher Yates wrote:
> PERL SNIPPET:
>
> # build arrays from file (OMITTED)
>
> use Pg;
> $dbhost='127.0.0.1';
> $dbname='mpact';
> #$connstr="dbname=$dbname";
> $connstr="host=$dbhost dbname=$dbname";
> $conn = Pg::connectdb($connstr);
>
> #more code related to date omitted
>
> $result=$conn->exec($sql);
> (PGRES_COMMAND_OK eq $result->resultStatus)
> or die $conn->errorMessage;
>
> WHY DO I GET PQsendQuery() -- There is no connection to the
> backend. I have tried leaving host blank, using IP 127.0.0.1 and
> hostname localhost. This script should work - the problem is
> something with postgres but I dont know what. Any ideas out
> there? Thanks, Kris
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
--
=================================================
Katherine (Kate) L. Collins
Senior Software Engineer/Meteorologist
Weather Services International (WSI Corporation)
900 Technology Park Drive
Billerica, MA 01821
EMAIL: kcollins(at)wsi(dot)com
PHONE: (978) 262-0610
FAX: (978) 262-0700
http://www.intellicast.com
From | Date | Subject | |
---|---|---|---|
Next Message | Allan Engelhardt | 2001-08-06 20:13:23 | Re: Data type confusion |
Previous Message | Kate Collins | 2001-08-06 19:59:35 | Re: prob with PERL/Postgres |