Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA04495; Mon, 7 Dec 92 17:47:11 -0800
Date: Mon, 7 Dec 92 17:47:11 -0800
Message-Id: <9212080147.AA04495@postgres.Berkeley.EDU>
From: neve@nlm.nih.gov (Leif Neve)
Subject: Are functions computed just once?
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

Folks,

I have a remote application which makes extensive use of functions, as in:

	retrieve (rel.attr) where rel.attr2 > some_func()

My question is, does some_func() get invoked just once and the result stored
for each ensuing comparison, or does the darn function get computed each time?

If the latter, is there a way of saying "compute this thing once and no more"?
Obviously I could do two queries, saving the result of some_func() the first
time through. But since the application is really remote, I'd rather not.

Leif Neve
