Re: Function call order dependency - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Function call order dependency
Date
Msg-id 603c8f070809030956n1d4cce92m3b35f08b9696dc08@mail.gmail.com
Whole thread Raw
In response to Re: Function call order dependency  (pgsql@mohawksoft.com)
Responses Re: Function call order dependency  (pgsql@mohawksoft.com)
List 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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: libpq object hooks (libpq events)
Next
From: pgsql@mohawksoft.com
Date:
Subject: Re: Function call order dependency