Re: ts_rewrite aggregate API seems mighty ugly - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: ts_rewrite aggregate API seems mighty ugly
Date
Msg-id 87myugwgnb.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: ts_rewrite aggregate API seems mighty ugly  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ts_rewrite aggregate API seems mighty ugly
List 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 by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Why copy_relation_data only use wal whenWALarchivingis enabled
Next
From: Gregory Stark
Date:
Subject: Re: Can a C function(server program) be a UDP or TCP server?