Re: Pg module and several result objects - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Pg module and several result objects
Date
Msg-id 20021011124614.GA5003@svana.org
Whole thread Raw
In response to Pg module and several result objects  ("Timur V. Irmatov" <itvthor@sdf.lonestar.org>)
List 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@svana.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.

pgsql-general by date:

Previous
From: "Timur V. Irmatov"
Date:
Subject: Pg module and several result objects
Next
From: "Warren Massengill"
Date:
Subject: Re: PHP and PostgreSQL