Re: socket connections - Mailing list pgsql-admin

From Randy Johnson
Subject Re: socket connections
Date
Msg-id 007c01c06c24$a7f2bee0$dd01a8c0@keneu.com
Whole thread Raw
In response to socket connections  ("Stuart Green" <sgreen@sitewarehouse.net>)
List pgsql-admin
"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




pgsql-admin by date:

Previous
From: R D
Date:
Subject: Re: Is that a bug?
Next
From: Stephan Szabo
Date:
Subject: Re: Is that a bug?