Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking
Дата
Msg-id
200510131436.j9DEajc04176@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
Minor point about contrib/xml2 functions "IMMUTABLE" marking John Gray <jgray@azuli.co.uk>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking Bruce Momjian <pgman@candle.pha.pa.us>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" Neil Conway <neilc@samurai.com>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking Bruce Momjian <pgman@candle.pha.pa.us>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking Tom Lane <tgl@sss.pgh.pa.us>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking Bruce Momjian <pgman@candle.pha.pa.us>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking Tom Lane <tgl@sss.pgh.pa.us>
Re: Minor point about contrib/xml2 functions "IMMUTABLE" marking Bruce Momjian <pgman@candle.pha.pa.us>
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

В списке pgsql-hackers по дате отправления
От: Andreas Pflug
Дата:
От: Tom Lane
Дата:
FAQ