Re: PGBouncer Connection Using Perl DBI - Mailing list pgsql-general

From prashantbharucha
Subject Re: PGBouncer Connection Using Perl DBI
Date
Msg-id 1346168026783-5721576.post@n5.nabble.com
Whole thread Raw
In response to Re: PGBouncer Connection Using Perl DBI  (Craig Ringer <ringerc@ringerc.id.au>)
Responses Re: PGBouncer Connection Using Perl DBI  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
Hi Craig

I got connection to pgbouncer,but how do i pass  actual database parameter
to connect .

I attached my perl script and getting error : prepared statement
"dbdpg_p27841_1"

Thanks

my  $PGDBNAME = 'test';
my  $PGDBSERVER = '172.16.40.19';
my  $PGDBUSER = 'postgres';
my  $PGDBPASSWD = 'postgres';
my  $PORT = '6432';
&main ();
sub main {

    my $dbh =
DBI->connect("dbi:Pg:dbname=$PGDBNAME;host=$PGDBSERVER;port=$PORT;",$PGDBUSER,$PGDBPASSWD,{
        RaiseError => 1,
        AutoCommit => 1,
    });
print ref($dbh);
    my $sql = qq {

                    select count(*) from a

                };

  my $cursor = $dbh->prepare($sql);
  $cursor->execute() ;
  my $raw = $cursor->fetchrow_hashref();
}




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/PGBouncer-Connection-Using-Perl-DBI-tp5721311p5721576.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: 9.2 and index only scans
Next
From: Jeff Janes
Date:
Subject: Re: PGBouncer Connection Using Perl DBI