Re: Function call order dependency

From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: pgsql(at)mohawksoft(dot)com
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Function call order dependency
Date: 2008-09-03 16:56:02
Message-ID: 603c8f070809030956n1d4cce92m3b35f08b9696dc08@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I was kind of afraid of that. So, how could one implement such a function
> set?

Write a function (say, score_contains) that returns NULL whenever
contains would return false, and the score otherwise.

SELECT * FROM (
SELECT *, score_contains(mytable.title, 'Winding Road', 1) AS
score FROM mytable
) x WHERE x.score IS NOT NULL
ORDER BY x.score

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-09-03 17:02:49 Re: libpq events patch
Previous Message pgsql 2008-09-03 16:55:45 Re: Function call order dependency