Re: Pg module and several result objects

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Timur V(dot) Irmatov" <itvthor(at)sdf(dot)lonestar(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Pg module and several result objects
Date: 2002-10-11 12:46:14
Message-ID: 20021011124614.GA5003@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 11, 2002 at 05:10:28PM +0500, Timur V. Irmatov wrote:
> Hello, People!
>
> I'm using Pg module to access PostgreSQL from my perl scripts. I have
> a question which is not clarified by reading man page..
>
> Suppose I have one query:
> my $res = $conn->exec(...);
> and then I perfrom seconf one:
> my $res2 = $conn->exec(...);
>
> Thus, I use two different result objects and perform fetchrow on them
> in turn. I think it is OK, and I have checked that on practice. But
> to be sure, I'd like to hear it from people who know the truth ;-)

Yes, you can do this. When you do the query, the entire result is shipped to
the client before it returns. So it works. It also means that if you have a
really large resultset, you'll need to use cursors to manage it.

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Warren Massengill 2002-10-11 12:56:48 Re: PHP and PostgreSQL
Previous Message snpe 2002-10-11 12:27:40 Re: Out of memory error on huge resultset