Rename tsvector delete() to ts_delete(), and filter() to ts_filter().
authorTom Lane
Thu, 5 May 2016 23:43:32 +0000 (19:43 -0400)
committerTom Lane
Thu, 5 May 2016 23:43:32 +0000 (19:43 -0400)
The similarity of the original names to SQL keywords seems like a bad
idea.  Rename them before we're stuck with 'em forever.

In passing, minor code and docs cleanup.

Discussion: <4875.1462210058@sss.pgh.pa.us>

doc/src/sgml/func.sgml
doc/src/sgml/textsearch.sgml
src/backend/utils/adt/tsvector_op.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/test/regress/expected/tstypes.out
src/test/regress/sql/tstypes.sql

index e1c3b48bf40305076a0f6e446c43d2642e56c632..c8dd838d2534ce60d81c6c2d77a96ae16b075fc1 100644 (file)
@@ -9177,6 +9177,18 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        
       
       
+       
+        
+         
+          array_to_tsvector
+         
+         array_to_tsvector(text[])
+        
+        tsvector
+        convert array of lexemes to tsvector
+        array_to_tsvector('{fat,cat,rat}'::text[])
+        'fat' 'cat' 'rat'
+       
        
         
          
@@ -9267,10 +9279,10 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
           setweight
           setweight for specific lexeme(s)
          
-         setweight(vector tsvector, weight "char", lexemes "text"[])
+         setweight(vector tsvector, weight "char", lexemes text[])
         
         tsvector
-        assign weight to elements of vector that are listed in lexemes array
+        assign weight to elements of vector that are listed in lexemes
         setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A', '{cat,rat}')
         'cat':3A 'fat':2,4 'rat':5A
        
@@ -9289,100 +9301,61 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        
         
          
-          delete
-          delete lexeme(s) from tsvector
+          to_tsquery
          
-         delete(vector tsvector, lexeme text)
-        
-        tsvector
-        remove given lexeme from vector
-        delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat')
-        'cat':3 'rat':5A
-       
-       
-        
-         
-         delete(vector tsvector, lexemes text[])
+         to_tsquery( config regconfig ,  query text)
         
-        tsvector
-        remove any occurrence of lexemes in lexemes array from vector>
-        delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat'])
-        'cat':3
+        tsquery
+        normalize words and convert to tsquery>
+        to_tsquery('english', 'The & Fat & Rats')
+        'fat' & 'rat'
        
        
         
          
-          unnest
-          for tsvector
+          to_tsvector
          
-         unnest(tsvector, OUT lexeme text, OUT positions smallint[], OUT weights text>)
+         to_tsvector( config regconfig ,  document text>)
         
-        setof record
-        expand a tsvector to a set of rows
-        unnest('fat:2,4 cat:3 rat:5A'::tsvector)
-        (cat,{3},{D}) ...
+        tsvector
+        reduce document text to tsvector
+        to_tsvector('english', 'The Fat Rats')
+        'fat':2 'rat':3
        
        
         
          
-          tsvector_to_array
+          ts_delete
          
-         tsvector_to_array(tsvector)
+         ts_delete(vector tsvector, lexeme text)
         
-        text[]
-        convert tsvector to array of lexemes
-        tsvector_to_array('fat:2,4 cat:3 rat:5A'::tsvector)
-        {cat,fat,rat}
+        tsvector
+        remove given lexeme from vector
+        ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat')
+        'cat':3 'rat':5A
        
        
         
-         
-          array_to_tsvector
-         
-         array_to_tsvector(text[])
+         
+         ts_delete(vector tsvector, lexemes text[])
         
         tsvector
-        convert array of lexemes to tsvectore>
-        array_to_tsvector('{fat,cat,rat}'::text[])
-        'fat' 'cat' 'rat'
+        remove any occurrence of lexemes in lexemes from vectore>
+        ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat'])
+        'cat':3
        
        
         
          
-          filter
-          for tsvector
+          ts_filter
          
-         filter(vector tsvector, weights "char"[])
+         ts_filter(vector tsvector, weights "char"[])
         
         tsvector
         Select only elements with given weights from vector
-        filter('fat:2,4 cat:3b rat:5A'::tsvector, '{a,b}')
+        ts_filter('fat:2,4 cat:3b rat:5A'::tsvector, '{a,b}')
         'cat':3B 'rat':5A
        
-       
-        
-         
-          to_tsquery
-         
-         to_tsquery( config regconfig ,  query text)
-        
-        tsquery
-        normalize words and convert to tsquery
-        to_tsquery('english', 'The & Fat & Rats')
-        'fat' & 'rat'
-       
-       
-        
-         
-          to_tsvector
-         
-         to_tsvector( config regconfig ,  document text)
-        
-        tsvector
-        reduce document text to tsvector
-        to_tsvector('english', 'The Fat Rats')
-        'fat':2 'rat':3
-       
        
         
          
@@ -9459,6 +9432,18 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
         tsquery_phrase(to_tsquery('fat'), to_tsquery('cat'), 10)
         'fat' <10> 'cat'
        
+       
+        
+         
+          tsvector_to_array
+         
+         tsvector_to_array(tsvector)
+        
+        text[]
+        convert tsvector to array of lexemes
+        tsvector_to_array('fat:2,4 cat:3 rat:5A'::tsvector)
+        {cat,fat,rat}
+       
        
         
          
@@ -9483,6 +9468,19 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
         CREATE TRIGGER ... tsvector_update_trigger_column(tsvcol, configcol, title, body)
         
        
+       
+        
+         
+          unnest
+          for tsvector
+         
+         unnest(tsvector, OUT lexeme text, OUT positions smallint[], OUT weights text)
+        
+        setof record
+        expand a tsvector to a set of rows
+        unnest('fat:2,4 cat:3 rat:5A'::tsvector)
+        (cat,{3},{D}) ...
+       
       
      
     
index 78eaf748676428515806bbc7da60c33acb330d46..bee1fbf1749bf448dc3ca5ee5766d9d8f2ecb548 100644 (file)
@@ -1412,7 +1412,8 @@ FROM (SELECT id, body, q, ts_rank_cd(ti, q) AS rank
    
 
    
-    Full list of tsvector-related functions available in .
+    A full list of tsvector-related functions is available
+    in .
    
 
   
index b138bf10ca124861a3d2ea740e88d80db08a38ab..591e59cf9902a2e558f30ca38049c5251f7b5123 100644 (file)
@@ -506,7 +506,7 @@ tsvector_delete_by_indices(TSVector tsv, int *indices_to_delete,
 
 /*
  * Delete given lexeme from tsvector.
- * Implementation of user-level delete(tsvector, text).
+ * Implementation of user-level ts_delete(tsvector, text).
  */
 Datum
 tsvector_delete_str(PG_FUNCTION_ARGS)
@@ -530,7 +530,7 @@ tsvector_delete_str(PG_FUNCTION_ARGS)
 
 /*
  * Delete given array of lexemes from tsvector.
- * Implementation of user-level delete(tsvector, text[]).
+ * Implementation of user-level ts_delete(tsvector, text[]).
  */
 Datum
 tsvector_delete_arr(PG_FUNCTION_ARGS)
@@ -757,7 +757,7 @@ array_to_tsvector(PG_FUNCTION_ARGS)
 }
 
 /*
- * Leave only elements with given weights from tsvector.
+ * ts_filter(): keep only lexemes with given weights in tsvector.
  */
 Datum
 tsvector_filter(PG_FUNCTION_ARGS)
@@ -771,15 +771,15 @@ tsvector_filter(PG_FUNCTION_ARGS)
               *dataout;
    Datum      *dweights;
    bool       *nulls;
-   int         nweigths;
+   int         nweights;
    int         i, j;
    int         cur_pos = 0;
    char        mask = 0;
 
    deconstruct_array(weights, CHAROID, 1, true, 'c',
-                     &dweights, &nulls, &nweigths);
+                     &dweights, &nulls, &nweights);
 
-   for (i = 0; i < nweigths; i++)
+   for (i = 0; i < nweights; i++)
    {
        char char_weight;
 
@@ -804,8 +804,9 @@ tsvector_filter(PG_FUNCTION_ARGS)
                mask = mask | 1;
                break;
            default:
-               /* internal error */
-               elog(ERROR, "unrecognized weight: %c", char_weight);
+           ereport(ERROR,
+                   (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                    errmsg("unrecognized weight: \"%c\"", char_weight)));
        }
    }
 
index a5eba196e9904f7748da286e38954bbe40cfd61d..08867fb06a32db5d98d999fd5db8cf368eeeb57c 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 201605031
+#define CATALOG_VERSION_NO 201605051
 
 #endif
index 021ba500ab87b88bbe37404269a0c58b106517f1..d94943ba6922e3168cca65f699f281ae2bab14f8 100644 (file)
@@ -4539,18 +4539,18 @@ DESCR("set given weight for whole tsvector");
 DATA(insert OID = 3320 (  setweight                PGNSP PGUID 12 1 0  0 0 f f f f t f i s 3 0 3614 "3614 18 1009" _null_ _null_ _null_ _null_ _null_ tsvector_setweight_by_filter _null_ _null_ _null_ ));
 DESCR("set given weight for given lexemes");
 DATA(insert OID = 3625 (  tsvector_concat      PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 3614" _null_ _null_ _null_ _null_ _null_ tsvector_concat _null_ _null_ _null_ ));
-DATA(insert OID = 3321 (  delete               PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 25" _null_ _null_ _null_ _null_ _null_ tsvector_delete_str _null_ _null_ _null_ ));
+DATA(insert OID = 3321 (  ts_delete                PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 25" _null_ _null_ _null_ _null_ _null_ tsvector_delete_str _null_ _null_ _null_ ));
 DESCR("delete lexeme");
-DATA(insert OID = 3323 (  delete               PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 1009" _null_ _null_ _null_ _null_ _null_ tsvector_delete_arr _null_ _null_ _null_ ));
+DATA(insert OID = 3323 (  ts_delete                PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 1009" _null_ _null_ _null_ _null_ _null_ tsvector_delete_arr _null_ _null_ _null_ ));
 DESCR("delete given lexemes");
 DATA(insert OID = 3322 (  unnest               PGNSP PGUID 12 1 10 0 0 f f f f t t i s 1 0 2249 "3614" "{3614,25,1005,1009}" "{i,o,o,o}" "{tsvector,lexeme,positions,weights}"  _null_ _null_ tsvector_unnest _null_ _null_ _null_ ));
 DESCR("expand tsvector to set of rows");
 DATA(insert OID = 3326 (  tsvector_to_array        PGNSP PGUID 12 1 0  0 0 f f f f t f i s 1 0 1009 "3614" _null_ _null_ _null_ _null_ _null_ tsvector_to_array _null_ _null_ _null_ ));
-DESCR("convert to lexeme's array");
+DESCR("convert tsvector to array of lexemes");
 DATA(insert OID = 3327 (  array_to_tsvector        PGNSP PGUID 12 1 0  0 0 f f f f t f i s 1 0 3614 "1009" _null_ _null_ _null_ _null_ _null_ array_to_tsvector _null_ _null_ _null_ ));
-DESCR("build tsvector from lexeme's array");
-DATA(insert OID = 3319 (  filter               PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 1002" _null_ _null_ _null_ _null_ _null_ tsvector_filter _null_ _null_ _null_ ));
-DESCR("returns tsvector that contain only postings with given weights");
+DESCR("build tsvector from array of lexemes");
+DATA(insert OID = 3319 (  ts_filter                PGNSP PGUID 12 1 0  0 0 f f f f t f i s 2 0 3614 "3614 1002" _null_ _null_ _null_ _null_ _null_ tsvector_filter _null_ _null_ _null_ ));
+DESCR("delete lexemes that do not have one of the given weights");
 
 DATA(insert OID = 3634 (  ts_match_vq          PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "3614 3615" _null_ _null_ _null_ _null_ _null_ ts_match_vq _null_ _null_ _null_ ));
 DATA(insert OID = 3635 (  ts_match_qv          PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "3615 3614" _null_ _null_ _null_ _null_ _null_ ts_match_qv _null_ _null_ _null_ ));
index c8ca0624d439e89ad36342db029c3c8e3b0ccc98..64d6de6050a6ef768976681df8d5d630e82aed45 100644 (file)
@@ -979,73 +979,73 @@ SELECT strip('base hidden rebel spaceship strike'::tsvector);
  'base' 'hidden' 'rebel' 'spaceship' 'strike'
 (1 row)
 
-SELECT delete(to_tsvector('english', 'Rebel spaceships, striking from a hidden base'), 'spaceship');
-                  delete                  
+SELECT ts_delete(to_tsvector('english', 'Rebel spaceships, striking from a hidden base'), 'spaceship');
+                ts_delete                 
 ------------------------------------------
  'base':7 'hidden':6 'rebel':1 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'base');
-                            delete                            
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'base');
+                          ts_delete                           
 --------------------------------------------------------------
  'hidden':6 'rebel':1 'spaceship':2,33A,34B,35C,36 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bas');
-                                delete                                 
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bas');
+                               ts_delete                               
 -----------------------------------------------------------------------
  'base':7 'hidden':6 'rebel':1 'spaceship':2,33A,34B,35C,36 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bases');
-                                delete                                 
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bases');
+                               ts_delete                               
 -----------------------------------------------------------------------
  'base':7 'hidden':6 'rebel':1 'spaceship':2,33A,34B,35C,36 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'spaceship');
-                  delete                  
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'spaceship');
+                ts_delete                 
 ------------------------------------------
  'base':7 'hidden':6 'rebel':1 'strike':3
 (1 row)
 
-SELECT delete('base hidden rebel spaceship strike'::tsvector, 'spaceship');
-              delete              
+SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, 'spaceship');
+            ts_delete             
 ----------------------------------
  'base' 'hidden' 'rebel' 'strike'
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','rebel']);
-             delete             
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','rebel']);
+           ts_delete            
 --------------------------------
  'base':7 'hidden':6 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceships','rebel']);
-                           delete                            
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceships','rebel']);
+                          ts_delete                          
 -------------------------------------------------------------
  'base':7 'hidden':6 'spaceship':2,33A,34B,35C,36 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceshi','rebel']);
-                           delete                            
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceshi','rebel']);
+                          ts_delete                          
 -------------------------------------------------------------
  'base':7 'hidden':6 'spaceship':2,33A,34B,35C,36 'strike':3
 (1 row)
 
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','leya','rebel']);
-             delete             
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','leya','rebel']);
+           ts_delete            
 --------------------------------
  'base':7 'hidden':6 'strike':3
 (1 row)
 
-SELECT delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel']);
-          delete          
+SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel']);
+        ts_delete         
 --------------------------
  'base' 'hidden' 'strike'
 (1 row)
 
-SELECT delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL]);
+SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL]);
 ERROR:  lexeme array may not contain nulls
 SELECT unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
                    unnest                    
@@ -1155,17 +1155,17 @@ SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
 
 SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', ARRAY['a', 'zxc', NULL]);
 ERROR:  lexeme array may not contain nulls
-SELECT filter('base:7A empir:17 evil:15 first:11 galact:16 hidden:6A rebel:1A spaceship:2A strike:3A victori:12 won:9'::tsvector, '{a}');
-                           filter                            
+SELECT ts_filter('base:7A empir:17 evil:15 first:11 galact:16 hidden:6A rebel:1A spaceship:2A strike:3A victori:12 won:9'::tsvector, '{a}');
+                          ts_filter                          
 -------------------------------------------------------------
  'base':7A 'hidden':6A 'rebel':1A 'spaceship':2A 'strike':3A
 (1 row)
 
-SELECT filter('base hidden rebel spaceship strike'::tsvector, '{a}');
- filter 
---------
+SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a}');
ts_filter 
+-----------
  
 (1 row)
 
-SELECT filter('base hidden rebel spaceship strike'::tsvector, '{a,b,NULL}');
+SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a,b,NULL}');
 ERROR:  weight array may not contain nulls
index ecc71c85e68efb8a5900ee49777644b74db0e742..738ec824b99ab4e9d62077aeec5e7f5cb6c97050 100644 (file)
@@ -193,19 +193,19 @@ SELECT strip('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd'::tsvector);
 SELECT strip('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
 SELECT strip('base hidden rebel spaceship strike'::tsvector);
 
-SELECT delete(to_tsvector('english', 'Rebel spaceships, striking from a hidden base'), 'spaceship');
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'base');
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bas');
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bases');
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'spaceship');
-SELECT delete('base hidden rebel spaceship strike'::tsvector, 'spaceship');
-
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','rebel']);
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceships','rebel']);
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceshi','rebel']);
-SELECT delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','leya','rebel']);
-SELECT delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel']);
-SELECT delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL]);
+SELECT ts_delete(to_tsvector('english', 'Rebel spaceships, striking from a hidden base'), 'spaceship');
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'base');
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bas');
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bases');
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'spaceship');
+SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, 'spaceship');
+
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','rebel']);
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceships','rebel']);
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceshi','rebel']);
+SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','leya','rebel']);
+SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel']);
+SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL]);
 
 SELECT unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
 SELECT unnest('base hidden rebel spaceship strike'::tsvector);
@@ -227,6 +227,6 @@ SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '
 SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
 SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', ARRAY['a', 'zxc', NULL]);
 
-SELECT filter('base:7A empir:17 evil:15 first:11 galact:16 hidden:6A rebel:1A spaceship:2A strike:3A victori:12 won:9'::tsvector, '{a}');
-SELECT filter('base hidden rebel spaceship strike'::tsvector, '{a}');
-SELECT filter('base hidden rebel spaceship strike'::tsvector, '{a,b,NULL}');
+SELECT ts_filter('base:7A empir:17 evil:15 first:11 galact:16 hidden:6A rebel:1A spaceship:2A strike:3A victori:12 won:9'::tsvector, '{a}');
+SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a}');
+SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a,b,NULL}');