Received: from redbox.venux.net (redbox.venux.net [216.47.238.10]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA64142 for ; Mon, 16 Aug 1999 16:51:46 -0400 (EDT) (envelope-from matthew@venux.net) Received: from thunder (net177138.hcv.com [209.153.177.138]) by redbox.venux.net (Postfix) with SMTP id 8714E2E20E; Mon, 16 Aug 1999 16:51:05 -0400 (EDT) Message-Id: <4.1.19990816164740.00c9fda0@mail.venux.net> X-Sender: mhagerty@mail.venux.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Mon, 16 Aug 1999 16:52:01 -0400 To: Herouth Maoz , pgsql-sql@postgreSQL.org From: Matthew Hagerty Subject: Re: [SQL] Stepping through a table. In-Reply-To: References: <4.1.19990815225433.00cb6c20@mail.venux.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Thanks, I was thinking that's what cursors did, but I can't find a good source anywhere that actually tells you that you are reading one record at a time instead of submitting a whole query where the results are place in memory. You mentioned that cursors are read only. Can I do update statements while navigating with cursors? Or do they lock the records they are reading? Again, thank you. Matthew At 12:19 PM 8/16/99 +0300, Herouth Maoz wrote: >At 05:58 +0300 on 16/08/1999, Matthew Hagerty wrote: > > >> If I need to process each record in a table, how can I step through each >> record? I suppose I could write a query to return all records and fetch >> each row that way, but that would be a big memory pig, no? Also, the table >> could get pretty big. Is there some way to navigate a table, maybe >> fetching one record from the disk at a time, or something similar? > >I guess you are looking for cursors. Read about it on page 154 of the >PostgreSQL user guide, or check out the manpage about "declare". Note that >PostgreSQL cursors are readonly, and can't be used to update information. > >Herouth > >-- >Herouth Maoz, Internet developer. >Open University of Israel - Telem project >http://telem.openu.ac.il/~herutma > >