pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
socket connections
2+ messages / 2 participants
[nested] [flat]

* socket connections
@ 2000-12-20 15:17  Stuart Green <sgreen@sitewarehouse.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Stuart Green @ 2000-12-20 15:17 UTC (permalink / raw)
  To: pgsql-admin

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: socket connections
@ 2000-12-22 14:37  Randy Johnson <rs.johnson@bigfoot.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Randy Johnson @ 2000-12-22 14:37 UTC (permalink / raw)
  To: 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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-12-22 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 15:17 socket connections Stuart Green <sgreen@sitewarehouse.net>
2000-12-22 14:37 Re: socket connections Randy Johnson <rs.johnson@bigfoot.com>

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