Re: ts_rewrite aggregate API seems mighty ugly
От | Gregory Stark |
---|---|
Тема | Re: ts_rewrite aggregate API seems mighty ugly |
Дата | |
Msg-id | 87myugwgnb.fsf@oxford.xeocode.com обсуждение исходный текст |
Ответ на | Re: ts_rewrite aggregate API seems mighty ugly (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: ts_rewrite aggregate API seems mighty ugly
|
Список | pgsql-hackers |
"Tom Lane" <tgl@sss.pgh.pa.us> writes: > Gregory Stark <stark@enterprisedb.com> writes: >> The two-argument form may not be actively broken but it sounds not very >> integrated. Passing a string which is then planned as an SQL query is not very >> SQL-ish. > > True. I'll bet you don't like ts_stat() either. It seems the right way interface here wouldn't be too different from what's there. All we need is a SRF which takes a single tsvector and returns the set of words from it. Then you could do the aggregates yourself in SQL: SELECT count(distinct apodid) as ndoc, count(*) as nentry, element FROM ( SELECT apodid, ts_elements(vector) ASelement FROM apod ) GROUP BY element -- Gregory Stark EnterpriseDB http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: