Re: tsvector extraction patch - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: tsvector extraction patch
Date
Msg-id 200907061043.43684.peter_e@gmx.net
Whole thread Raw
In response to tsvector extraction patch  (Hans-Juergen Schoenig -- PostgreSQL <postgres@cybertec.at>)
List pgsql-hackers
On Friday 03 July 2009 10:49:41 Hans-Juergen Schoenig -- PostgreSQL wrote:
> hello,
>
> this patch has not made it through yesterday, so i am trying to send it
> again.
> i made a small patch which i found useful for my personal tasks.
> it would be nice to see this in 8.5. if not core then maybe contrib.
> it transforms a tsvector to table format which is really nice for text
> processing and comparison.
>
> test=# SELECT * FROM tsvcontent(to_tsvector('english', 'i am pretty sure
> this is a good patch'));
>  lex   | rank
> --------+------
> good   |    8
> patch  |    9
> pretti |    3
> sure   |    4
> (4 rows)

Sounds useful.  But in the interest of orthogonality (or whatever), how about 
instead you write a cast from tsvector to text[], and then you can use 
unnest() to convert that to a table, e.g.,

SELECT * FROM unnest(CAST(to_tsvector('...') AS text[]));



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: First CommitFest: July 15th
Next
From: Dimitri Fontaine
Date:
Subject: Re: Feedback on writing extensible modules