Re: Tsvector editing functions - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: Tsvector editing functions
Date
Msg-id 56E1AEF1.6050006@sigaev.ru
Whole thread Raw
In response to Re: Tsvector editing functions  (Stas Kelvich <s.kelvich@postgrespro.ru>)
Responses Re: Tsvector editing functions
List pgsql-hackers
> Thanks! Fixed and added tests.
Thank you!

I did some patch cleanup/fix, but I have some doubt with function's names:

1 to_tsvector:
# \df to_tsvector
                              List of functions
    Schema   |    Name     | Result data type | Argument data types |  Type
------------+-------------+------------------+---------------------+--------
  pg_catalog | to_tsvector | tsvector         | regconfig, text     | normal
  pg_catalog | to_tsvector | tsvector         | text                | normal
  pg_catalog | to_tsvector | tsvector         | text[]              | normal

First two variants of to_tsvector make a morphological processing, last one doesn't.

2 to_array
# \df *to_array
                                   List of functions
    Schema   |         Name          | Result data type | Argument data types |
  Type
------------+-----------------------+------------------+---------------------+--------
  pg_catalog | regexp_split_to_array | text[]           | text, text          |
normal
  pg_catalog | regexp_split_to_array | text[]           | text, text, text    |
normal
  pg_catalog | string_to_array       | text[]           | text, text          |
normal
  pg_catalog | string_to_array       | text[]           | text, text, text    |
normal
  pg_catalog | to_array              | text[]           | tsvector            |
normal

Seems, to_array is not a right name compared to other *to_array.

I would like to suggest rename both functions to array_to_tsvector and
tsvector_to_array to have consistent name. Later we could add
to_tsvector([regconfig, ], text[]) with morphological processing.

Thoughts?



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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Endless loop calling PL/Python set returning functions
Next
From: Petr Jelinek
Date:
Subject: Re: WAL log only necessary part of 2PC GID