Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.4) with SMTP id f7DDZSP58856 for ; Mon, 13 Aug 2001 09:35:28 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from www2.intellicast.com ([208.194.150.24]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f76Jxq611551 for ; Mon, 6 Aug 2001 15:59:52 -0400 (EDT) (envelope-from kcollins@wsi.com) Received: from wsi.com (ravens.wsicorp.com [147.81.85.104]) by www2.intellicast.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id PAA01952; Mon, 6 Aug 2001 15:59:35 -0400 (EDT) Message-ID: <3B6EF727.DF77B297@wsi.com> Date: Mon, 06 Aug 2001 15:59:35 -0400 From: Kate Collins X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: kris@grinz.com CC: pgsql-sql@postgresql.org Subject: Re: prob with PERL/Postgres References: <3B6EA444.13097.C20296@localhost> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200108/164 X-Sequence-Number: 4385 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@wsi.com PHONE: (978) 262-0610 FAX: (978) 262-0700 http://www.intellicast.com