Received: from neo-dial.neo.rr.com (neo-dial.neo.rr.com [204.210.223.26]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBMJbQ623552 for ; Fri, 22 Dec 2000 14:37:26 -0500 (EST) (envelope-from rs.johnson@bigfoot.com) Received: from pb (a2-2d149.neo.rr.com [24.93.203.149]) by neo-dial.neo.rr.com (8.9.3/8.9.3) with SMTP id OAA23389 for ; Fri, 22 Dec 2000 14:36:53 -0500 (EST) Message-ID: <007c01c06c24$a7f2bee0$dd01a8c0@keneu.com> From: "Randy Johnson" To: Subject: Re: socket connections Date: Fri, 22 Dec 2000 14:37:01 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200012/142 X-Sequence-Number: 338 "Stuart Green" wrote in message news:<91qihh$1uer$1@news.tht.net>... > How do you force a postgres connection via a TCPIP socket and not a Unix > Socket when connecting through the perl DBI? > > I found something in the postgres docs in the SSL area with a switch "-h > localhost" (this is not in the man pages) but that didn't seem to do > anything. > > Thanks > > Hi. I use something like this: my $dsn = "dbi:Pg:dbname=mydb;host=localhost;port=5432"; my $dbh = DBI->connect("$dsn", "$username", "$password"); This works whether the host is localhost or not. Make sure that the postmaster is started with the -i option. The full syntax of the DBI connect is: $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;options=$options;t ty=$tty", "$username", "$password"); Try 'perldoc DBD::Pg' for details. Cheers, Randy Johnson