Subject: portal behavior question

From: "Patrick M. Landry" <[email-masked]>
Date: Wed, 27 May 92 15:49:41 -0700

I am writing a GUI postgres database browser.
In order to implement the "next" and "previous" browsing functions
I currently do sonething like
	begin
	retrieve portal foo (TABLE.all) 
	end
Then for a next I do
	fetch forward 1 in foo
and for previous I do
	fetch backward 1 in foo

This all works fine. 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)

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?
--
patrick
[email-masked]

---

From: <[email-masked]>
Date: Wed, 27 May 92 16:11:05 PDT

In message <[email-masked]> you write:

> I was surprised (and glad) to find out that

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.

> I am also curios as to why this works. Is the retrieve executed

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
					[email-masked]