[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I would like to be able to say:
>
> SELECT url,score_a(text, CAST('term' AS TEXT)) AS score FROM articles
> WHERE score > 0
> ORDER BY score DESC;
>
> This returns: ERROR: Attribute 'score' not found.
We just don't support aliases in WHERE, as you suggest. I see your
problem if score_a is complicated. The issue is that the target list is
not evaluated until _after_ the WHERE clause.
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026