Re: tsvector extraction patch

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Hans-Juergen Schoenig -- PostgreSQL" <postgres(at)cybertec(dot)at>, zb(at)cybertec(dot)at
Subject: Re: tsvector extraction patch
Date: 2009-07-06 07:43:43
Message-ID: 200907061043.43684.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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[]));

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2009-07-06 08:50:27 Re: Feedback on writing extensible modules
Previous Message Peter Eisentraut 2009-07-06 07:33:14 Re: First CommitFest: July 15th