Neil Conway wrote:
> On Wed, 2005-12-10 at 23:46 -0400, Bruce Momjian wrote:
> > Agreed.  I have changed them both to stable.  I think xslt_process()
> > should be stable because it is unlikely you would want a URL's contents
> > to change inside a transaction
> 
> Why is it "unlikely"?
> 
> If a function's return value for a particular set of arguments could
> change within a single table scan, the function is volatile -- ISTM
> xslt_process() clearly falls within that definition.

My thought was that a web page lookup is going to be a very expensive
operation, so you would not want it to requery inside a transaction.

It is not like random() where you want it to be re-called and it is
inexpensive.

Our documentation says about VOLATILE:

              VOLATILE  indicates  that  the  function  value can
              change even within a single table scan, so no opti-
              mizations  can  be  made.  Relatively  few database
              functions are volatile in this sense; some examples
              are random(), currval(), timeofday(). Note that any
              function that has side-effects must  be  classified
              volatile,  even if its result is quite predictable,
              to prevent calls  from  being  optimized  away;  an
              example is setval().

and I didn't think a web page lookup fit in that category.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to