Re: referring to computed values from the select list in the where and order clauses

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: referring to computed values from the select list in the where and order clauses
Дата
Msg-id 200403010921.32427.dev@archonet.com
обсуждение исходный текст
Ответ на referring to computed values from the select list in the where and order clauses  (Stephen Howard <stephen@thunkit.com>)
Ответы Re: referring to computed values from the select list in the where and order clauses  (Martijn van Oosterhout <kleptog@svana.org>)
Re: referring to computed values from the select list in the where and order clauses  ("Karl O. Pinc" <kop@meme.com>)
Список pgsql-general
On Monday 01 March 2004 01:04, Stephen Howard wrote:
> I've got a moderately complex function defined which i then want to be
>
> able to test the value of, as well as select the value:
>
> select id, vector_cosine(document,'[ qw( foo,bar,baz )]') as threshold
> from search_vectorspace where threshold > 0 order by threshold desc;

Can't be done that way, I'm afraid. The aliasing is defined as occuring after
the where clause has been evaluated.

However, you can mark functions as immutable/stable/volatile which can allow
PG to cache the query results. See the manuals (CREATE FUNCTION) for details.

--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: Shridhar Daithankar
Дата:
Сообщение: Re: PostgreSQL insert speed tests
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: referring to computed values from the select list in the where and order clauses