Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA07030; Wed, 27 May 92 16:02:49 -0700
Message-Id: <9205272302.AA07030@postgres.Berkeley.EDU>
From: <mao@postgres.berkeley.edu>
Subject: Re: portal behavior question
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Wed, 27 May 92 15:49:41 PST.
             <9205272249.AA06669@postgres.Berkeley.EDU> 
Date: Wed, 27 May 92 16:11:05 PDT

In message <9205272249.AA06669@postgres.Berkeley.EDU> you write:

> I was surprised (and glad) to find out that
> if a tuple is added to the TABLE after I perform the retrive the 
> portal is somehow updated and a subsequent fetch will retrive the
> newly added tuple. (hope that is clear)

this should only happen for tuples that YOU add, not for tuples that
are added by other users running concurrently with you.  visibility
rules for updates allow you to see changes you make during your
transaction, but not changes made in other transactions running
concurrently.

> My question is whether or not I can depend on this behavior. 
> I am also curios as to why this works. Is the retrieve executed
> every time I do a fetch?

you can depend on this behavior.  tuples are retrieved on demand
(that is, when you say 'fetch').  the initial retrieve statement
just allocates some state in the postgres executor that's used to
satisfy your requests for tuples as you make them.

					mike olson
					project sequoia 2000
					uc berkeley
					mao@cs.berkeley.edu
