From: | "Randy Johnson" <rs(dot)johnson(at)bigfoot(dot)com> |
---|---|
To: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: socket connections |
Date: | 2000-12-22 14:37:01 |
Message-ID: | 007c01c06c24$a7f2bee0$dd01a8c0@keneu.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
"Stuart Green" <sgreen(at)sitewarehouse(dot)net> wrote in message
news:<91qihh$1uer$1(at)news(dot)tht(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas SMETS | 2000-12-24 13:18:50 | Running a file |
Previous Message | Marcos Rogerio Nunes de Assuncao | 2000-12-22 14:08:06 | data problem |