Re: Function call order dependency

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function call order dependency
Дата
Msg-id 20971.1220454319@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function call order dependency  (pgsql@mohawksoft.com)
Ответы Re: Function call order dependency
Re: Function call order dependency
Список pgsql-hackers
pgsql@mohawksoft.com writes:
> For example I'll use the Oracle "contains" function, though this is not
> exactly what I'm doing, it just illustrates the issue clearly.

> select *, score(1) from mytable where contains(mytable.title, 'Winding
> Road', 1) order by score(1);

> The "contains" function does a match against mytable.title for the term
> 'Winding Road' and both returns and saves an integer score which may be
> retrieved later using the "score(...)" function.

This is just a bad, bad idea.  Side-effects in a WHERE-clause function
are guaranteed to cause headaches.  When (not if) it breaks, you get
to keep both pieces.
        regards, tom lane


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: [PATCH] Cleanup of GUC units code
Следующее
От: "Stephen R. van den Berg"
Дата:
Сообщение: Re: Function call order dependency