I use the Perl DBI module to connect to a postgres data base on the local
system. I don't specify the host name. This is the syntax I use to connect to
the data base:
use DBI;
$dbname = "foo";
$connstr = "dbi:Pg:dbname=$dbname";
$dbh = DBI->connect($connstr);
Kristopher Yates wrote:
> PERL S
On Mon, 6 Aug 2001, Tom Lane wrote:
> Thomas Good <[EMAIL PROTECTED]> writes:
> > Kate, he uses a diff module by the same author (Edmund Mergl) but with
> > a very diff syntax. The advantage of the DBI - Kris, if you're
> > interested - is that the syntax is much like ESQL/C and the code is
> >
Thomas Good <[EMAIL PROTECTED]> writes:
> Kate, he uses a diff module by the same author (Edmund Mergl) but with
> a very diff syntax. The advantage of the DBI - Kris, if you're
> interested - is that the syntax is much like ESQL/C and the code is
> much more portable. For example I use DBI to a
On Mon, 6 Aug 2001, Kate Collins wrote:
> I use the Perl DBI module to connect to a postgres data base on the local
> system. I don't specify the host name. This is the syntax I use to connect to
> the data base:
>
> use DBI;
>
> $dbname = "foo";
> $connstr = "dbi:Pg:dbname=$dbname";
> $dbh =
Kristopher Yates wrote:
>PERL SNIPPET:
>
># build arrays from file (OMITTED)
>
>use Pg;
>$dbhost='127.0.0.1';
>$dbname='mpact';
>#$connstr="dbname=$dbname";
>$connstr="host=$dbhost dbname=$dbname";
>$conn = Pg::connectdb($connstr);
>
>#more code related to date omitted
>
>$result=$conn->exec(
I use the Perl DBI module to connect to a postgres data base on the local
system. I don't specify the host name. This is the syntax I use to connect to
the data base:
use DBI;
$dbname = "foo";
$connstr = "dbi:Pg:dbname=$dbname";
$dbh = DBI->connect($connstr);
Kristopher Yates wrote:
> PERL S
PERL SNIPPET:
# build arrays from file (OMITTED)
use Pg;
$dbhost='127.0.0.1';
$dbname='mpact';
#$connstr="dbname=$dbname";
$connstr="host=$dbhost dbname=$dbname";
$conn = Pg::connectdb($connstr);
#more code related to date omitted
$result=$conn->exec($sql);
(PGRES_COMMAND_OK eq $result