add, subtract bool type
От | Jeff Davis |
---|---|
Тема | add, subtract bool type |
Дата | |
Msg-id | 3B8353A3.40705@dynworks.com обсуждение исходный текст |
Ответы |
Re: add, subtract bool type
Re: add, subtract bool type |
Список | pgsql-general |
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
В списке pgsql-general по дате отправления: