From: Randy Johnson <rs.johnson@bigfoot.com>
To: pgsql-admin@postgresql.org
Subject: Re: socket connections
Date: Fri, 22 Dec 2000 14:37:01 -0000
Message-ID: <007c01c06c24$a7f2bee0$dd01a8c0@keneu.com> (raw)
"Stuart Green" <sgreen@sitewarehouse.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: rs.johnson@bigfoot.com
Subject: Re: socket connections
In-Reply-To: <007c01c06c24$a7f2bee0$dd01a8c0@keneu.com>
References: <007c01c06c24$a7f2bee0$dd01a8c0@keneu.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox