Обсуждение: Simple DBI question.

Поиск
Список
Период
Сортировка

Simple DBI question.

От
David Siebert
Дата:
How do I connect to a postgres sever across a network using DBI?
I can not find an example of it anywhere in any docs.
Thanks.
Also what do I type after man to get the Pg dbi man file?




Re: Simple DBI question.

От
"Thomas A. Lowery"
Дата:
On Tue, Aug 12, 2003 at 04:58:49PM -0400, David Siebert wrote:
> How do I connect to a postgres sever across a network using DBI?
> I can not find an example of it anywhere in any docs.

connect string like "dbi:Pg:dbname=db;host=machine;port=5432"
Example:

use DBI;

my $dbh = DBI->connect( "dbi:Pg:dbname=db;host=db_server;port=5432",
    "test", "test", {RaiseError => 1} ) or die "Unable to connect: $DBI::errstr\n";
$dbh->disconnect;

> Thanks.
> Also what do I type after man to get the Pg dbi man file?

perldoc DBI
perldoc DBD:Pg