Re: Tsvector editing functions - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: Tsvector editing functions
Date
Msg-id 56B0E31E.0@sigaev.ru
Whole thread Raw
In response to Re: Tsvector editing functions  (Stas Kelvich <s.kelvich@postgrespro.ru>)
Responses Re: Tsvector editing functions
Re: Tsvector editing functions
List pgsql-hackers
Some notices:

1 tsin in documentation doesn't look like a good name. Changed to vector similar 
to other places.

2 I did some editorization about freeing memory/forgotten names etc

3 It seems to me that tsvector_unnest() could be seriously optimized for
large tsvectors: with current coding it detoasts/decompresses tsvector value on 
each call. Much better to do it once in
multi_call_memory_ctx context at first call init

4 It seems debatable returning empty array for position/weight if they are absent:
=# select * from unnest('a:1 b'::tsvector); lexeme | positions | weights
--------+-----------+--------- a      | {1}       | {D} b      | {}        | {}
I think, it's better to return NULL in this case

5 
array_to_tsvector/tsvector_setweight_by_filter/tsvector_delete_arr/tsvector_filter 
doesn't check or pay attention to NULL elements in input arrays





-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Relation extension scalability
Next
From: Teodor Sigaev
Date:
Subject: Re: Tsvector editing functions