Re: DBI/DBD::Pg mem. use goes exponential

From: Keary Suska <hierophant(at)pcisys(dot)net>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: DBI/DBD::Pg mem. use goes exponential
Date: 2005-09-29 17:23:22
Message-ID: BF617F2A.21CC6%hierophant@pcisys.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

on 9/29/05 6:38 AM, rwp(at)biome(dot)ac(dot)uk purportedly said:

> Any ideas please? This seems well weird to me, but...

Assuming the code snippet is representative, a couple things:

1. $dbh->prepare($stmt)->execute () || die;

This is mostly a point of protocol, but I can't resist pointing it out.
Although the above syntax works, it is not precisely correct. You should
instead:

$dbh->do($stmt) || die;

2. my $rv=$sth->execute() || die;

You should always finish() every "select" statement handle, or both DBI and
libpq will leak:

$sth->finish;

after the closing bracket of the while() loop.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-09-29 17:24:36 Re: insertion becoming slow
Previous Message Jan Wieck 2005-09-29 16:19:33 Re: Triggers after a rule