Function call order dependency

Поиск
Список
Период
Сортировка
От pgsql@mohawksoft.com
Тема Function call order dependency
Дата
Msg-id 45362.71.232.149.185.1220444648.squirrel@mail.mohawksoft.com
обсуждение исходный текст
Ответы Re: Function call order dependency
Re: Function call order dependency
Список pgsql-hackers
Is there a knowable order in which functions are called within a query in
PostgreSQL?

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. The integer used as a
parameter in score(...) and contains(...) is an index to reference which
score you need as more than one contains(...) call may be used in single
query.

This sets up an interesting issue, how can one ensure that "contains()" is
called prior to any "score()" function on each row? Is this possible? Is
there a specific order on which you can count?

Would it be something like: "where" clause first, left to right, followed
by select terms, left to right, and lastly the "order by" clause?


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

Предыдущее
От: "Hitoshi Harada"
Дата:
Сообщение: Re: Window functions patch v04 for the September commit fest
Следующее
От: Andrew Chernow
Дата:
Сообщение: Re: libpq object hooks (libpq events)