Re: function side effects

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: function side effects
Дата
Msg-id 407d949e1002231018r191ad206ye01561f98caf6fc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: function side effects  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: function side effects  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
On Tue, Feb 23, 2010 at 4:52 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Right, we all know it currently doesn't throw an error, but I can't
> think of anywhere I'd like to have someone do that in a database for
> which I have any responsibility.  Does anyone have a sane use case
> for a non-volatile function to call a volatile one or to update the
> database?

So consider for example a function which explicitly sets the timezone
and then uses timestamp without timezone functions (which are volatile
only because the GUC variable might change between calls).

Or somebody who uses the tsearch functions because they're planning to
not change their dictionaries.

Or builds a hash function by calling random after setting the seed to
a specific value -- this is actually a fairly popular strategy for
building good hash functions.

--
greg


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] 8.5 TODO: Add comments to output indicating version of pg_dump and of the database server
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] backend: compare word-at-a-time in bcTruelen