Newbie to Postgres - Urgent query - Mailing list pgsql-general

From Ritu Khetan
Subject Newbie to Postgres - Urgent query
Date
Msg-id 1074244727.3623.13.camel@efv2.netcore.co.in
Whole thread Raw
Responses Re: Newbie to Postgres - Urgent query
Re: Newbie to Postgres - Urgent query
List pgsql-general
Hello all,

    I am trying to use DBI in perl to connect to my Postgres database. I am able to connect to the database but when any further queries are made using the database handle, I see the following message in my error logs and no results are generated -

"NOTICE:  current transaction is aborted, queries ignored until end of transaction block"

Please help on what could be going wrong.

Here's a part of my code :

$dbh = DBI->connect(DBI:Pg:dbname=dbname, $user_name, $password, { RaiseError => 0, PrintError => 0, AutoCommit => 0});
my $results = "select * from user_regs order by id desc";
my $ids = $dbh->prepare($results);
my $sth = $ids->execute;

$iderr = $ids->errstr;
if ($iderr) {
            print STDERR "Couldn't get usercount from user_regs";
            exit 0;
}

my @resultrows = $ids->fetchrow_array;
my $rowcount = scalar(@resultrows);
print STDERR "Rowcount: $rowcount\n";
exit 0;

Need urgent response.

Regards,
Ritu

----------------------------------------------------------------

NETCORE SOLUTIONS *** Ph: +91 22 5662 8000 Fax: +91 22 5662 8134

MailServ and FlexiMail: Messaging Solutions: http://netcore.co.in

Pragatee: Integrated Server-Software Suite: http://www.pragatee.com

Emergic Freedom: Server-centric Computing: http://www.emergic.com

BlogStreet: Blog Profiles and RSS Ecosystem: http://blogstreet.com

Deeshaa: Rural Development: http://www.deeshaa.com

Rajesh Jain's Weblog on Technology: http://www.emergic.org
----------------------------------------------------------------

pgsql-general by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Index space reusable?
Next
From: Richard Huxton
Date:
Subject: Re: how to catch the error in procedure ?