I made some simple functions that create the operators + and - for any 
combination of int4's and bool's.

The reasoning that propted this operator was that I wanted to use the 
following syntax in a query:
SELECT *,((col_a == 'foo') + (col_b == 'bar')) as relevance WHERE 
relevance > 0;

The idea is that the attribute 'relevance' counts the number of matching 
criteria. Such functionality would be most useful in a search engine, 
but may have other uses.

My question is two-part:
1) Is this a sane approach?
2) Might enough other people find a use that I should make a 
contribution somewhere (and would it be appropriate to send it to 
pgsql-hackers or pgsql-patches)? Is there a chance it will get 
incorporated into the main  source?

Regards,
Jeff Davis


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to