pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedNaming of new tsvector functions
15+ messages / 6 participants
[nested] [flat]
* Naming of new tsvector functions
@ 2016-05-02 17:27 Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:31 ` Re: Naming of new tsvector functions Joshua D. Drake <jd@commandprompt.com>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 15+ messages in thread
From: Tom Lane @ 2016-05-02 17:27 UTC (permalink / raw)
To: Teodor Sigaev <teodor@sigaev.ru>; +Cc: pgsql-hackers
I noticed that 6943a946c introduces some new functions named delete()
and filter(). This does not seem like a terribly bright idea to me.
They may not be formally ambiguous with the corresponding keywords,
but it's not very hard to imagine how small typos could lead to
the parser taking the unintended interpretation and then producing
totally confusing error messages. It's even less hard to imagine
this choice preventing us from introducing some new syntax in future
(for instance, DELETE ... RETURNING ... as a subquery-in-FROM) because
it *would* be formally ambiguous.
I think we'd be better off to rename these to tsvector_delete() and
tsvector_filter() while we still can.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-02 17:31 ` Joshua D. Drake <jd@commandprompt.com>
1 sibling, 0 replies; 15+ messages in thread
From: Joshua D. Drake @ 2016-05-02 17:31 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Teodor Sigaev <teodor@sigaev.ru>; +Cc: pgsql-hackers
On 05/02/2016 10:27 AM, Tom Lane wrote:
> I noticed that 6943a946c introduces some new functions named delete()
> and filter(). This does not seem like a terribly bright idea to me.
> They may not be formally ambiguous with the corresponding keywords,
> but it's not very hard to imagine how small typos could lead to
> the parser taking the unintended interpretation and then producing
> totally confusing error messages. It's even less hard to imagine
> this choice preventing us from introducing some new syntax in future
> (for instance, DELETE ... RETURNING ... as a subquery-in-FROM) because
> it *would* be formally ambiguous.
>
> I think we'd be better off to rename these to tsvector_delete() and
> tsvector_filter() while we still can.
or ts_filter/delete? but no objection
JD
>
> regards, tom lane
>
>
--
Command Prompt, Inc. http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-02 17:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 18:24 ` Re: Naming of new tsvector functions Robert Haas <robertmhaas@gmail.com>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
1 sibling, 2 replies; 15+ messages in thread
From: Tom Lane @ 2016-05-02 17:58 UTC (permalink / raw)
To: Teodor Sigaev <teodor@sigaev.ru>; +Cc: pgsql-hackers
I wrote:
> I think we'd be better off to rename these to tsvector_delete() and
> tsvector_filter() while we still can.
... although I now notice that hstore already exposes a function named
delete(), so that ship may have sailed already. But I'm more troubled
by filter() anyhow, since that keyword can appear in expressions ---
it seems much more likely that that would pose a parsing conflict
after future SQL extensions.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-02 18:24 ` Robert Haas <robertmhaas@gmail.com>
1 sibling, 0 replies; 15+ messages in thread
From: Robert Haas @ 2016-05-02 18:24 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Teodor Sigaev <teodor@sigaev.ru>; pgsql-hackers
On Mon, May 2, 2016 at 1:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
>> I think we'd be better off to rename these to tsvector_delete() and
>> tsvector_filter() while we still can.
>
> ... although I now notice that hstore already exposes a function named
> delete(), so that ship may have sailed already. But I'm more troubled
> by filter() anyhow, since that keyword can appear in expressions ---
> it seems much more likely that that would pose a parsing conflict
> after future SQL extensions.
But not everybody has hstore installed, so even if that's a problem it
won't be a problem for everybody, all the time. +1 for renaming them
both.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-02 21:59 ` David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
1 sibling, 1 reply; 15+ messages in thread
From: David Fetter @ 2016-05-02 21:59 UTC (permalink / raw)
To: pgsql-hackers
On Mon, May 02, 2016 at 01:58:11PM -0400, Tom Lane wrote:
> I wrote:
> > I think we'd be better off to rename these to tsvector_delete()
> > and tsvector_filter() while we still can.
>
> ... although I now notice that hstore already exposes a function
> named delete(), so that ship may have sailed already. But I'm more
> troubled by filter() anyhow, since that keyword can appear in
> expressions --- it seems much more likely that that would pose a
> parsing conflict after future SQL extensions.
I suspect that steering that ship would be a good idea starting with
deprecation of the old name in 9.6, etc. hs_filter(), perhaps?
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
@ 2016-05-04 13:43 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 15+ messages in thread
From: Stas Kelvich @ 2016-05-04 13:43 UTC (permalink / raw)
To: David Fetter <david@fetter.org>; +Cc: pgsql-hackers
> On 03 May 2016, at 00:59, David Fetter <david@fetter.org> wrote:
>
> On Mon, May 02, 2016 at 01:58:11PM -0400, Tom Lane wrote:
>> I wrote:
>>> I think we'd be better off to rename these to tsvector_delete()
>>> and tsvector_filter() while we still can.
>>
>> ... although I now notice that hstore already exposes a function
>> named delete(), so that ship may have sailed already. But I'm more
>> troubled by filter() anyhow, since that keyword can appear in
>> expressions --- it seems much more likely that that would pose a
>> parsing conflict after future SQL extensions.
>
> I suspect that steering that ship would be a good idea starting with
> deprecation of the old name in 9.6, etc. hs_filter(), perhaps?
>
> Cheers,
> David.
In 9.5 there already were tsvector functions length(), numnode(), strip()
Recent commit added setweight(), delete(), unnest(), tsvector_to_array(), array_to_tsvector(), filter().
Last bunch can be painlessly renamed, for example to ts_setweight, ts_delete, ts_unnest, ts_filter.
The question is what to do with old ones? Leave them as is? Rename to ts_* and create aliases with deprecation warning?
--
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
@ 2016-05-04 13:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
0 siblings, 1 reply; 15+ messages in thread
From: Tom Lane @ 2016-05-04 13:58 UTC (permalink / raw)
To: Stas Kelvich <s.kelvich@postgrespro.ru>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>> On 03 May 2016, at 00:59, David Fetter <david@fetter.org> wrote:
>> I suspect that steering that ship would be a good idea starting with
>> deprecation of the old name in 9.6, etc. hs_filter(), perhaps?
> In 9.5 there already were tsvector functions length(), numnode(), strip()
> Recent commit added setweight(), delete(), unnest(), tsvector_to_array(), array_to_tsvector(), filter().
> Last bunch can be painlessly renamed, for example to ts_setweight, ts_delete, ts_unnest, ts_filter.
> The question is what to do with old ones? Leave them as is? Rename to ts_* and create aliases with deprecation warning?
The other ones are not so problematic because they do not conflict with
SQL keywords. It's only delete() and filter() that scare me.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-04 16:25 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 15+ messages in thread
From: Stas Kelvich @ 2016-05-04 16:25 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
> On 04 May 2016, at 16:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>>> On 03 May 2016, at 00:59, David Fetter <david@fetter.org> wrote:
>>> I suspect that steering that ship would be a good idea starting with
>>> deprecation of the old name in 9.6, etc. hs_filter(), perhaps?
>
>> In 9.5 there already were tsvector functions length(), numnode(), strip()
>
>> Recent commit added setweight(), delete(), unnest(), tsvector_to_array(), array_to_tsvector(), filter().
>
>> Last bunch can be painlessly renamed, for example to ts_setweight, ts_delete, ts_unnest, ts_filter.
>
>> The question is what to do with old ones? Leave them as is? Rename to ts_* and create aliases with deprecation warning?
>
> The other ones are not so problematic because they do not conflict with
> SQL keywords. It's only delete() and filter() that scare me.
>
> regards, tom lane
Okay, so changed functions to ts_setweight, ts_delete, ts_unnest, ts_filter.
--
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
tsvector_ops_rename.diff (application/octet-stream, 27.7K) download
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index e1c3b48..5045c80 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -9252,26 +9252,26 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
<row>
<entry>
<indexterm>
- <primary>setweight</primary>
+ <primary>ts_setweight</primary>
</indexterm>
- <literal><function>setweight(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weight</replaceable> <type>"char"</>)</function></literal>
+ <literal><function>ts_setweight(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weight</replaceable> <type>"char"</>)</function></literal>
</entry>
<entry><type>tsvector</type></entry>
<entry>assign <replaceable class="PARAMETER">weight</replaceable> to each element of <replaceable class="PARAMETER">vector</replaceable></entry>
- <entry><literal>setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')</literal></entry>
+ <entry><literal>ts_setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')</literal></entry>
<entry><literal>'cat':3A 'fat':2A,4A 'rat':5A</literal></entry>
</row>
<row>
<entry>
<indexterm>
- <primary>setweight</primary>
- <secondary>setweight for specific lexeme(s)</secondary>
+ <primary>ts_setweight</primary>
+ <secondary>ts_setweight for specific lexeme(s)</secondary>
</indexterm>
- <literal><function>setweight(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weight</replaceable> <type>"char"</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>"text"[]</>)</function></literal>
+ <literal><function>ts_setweight(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weight</replaceable> <type>"char"</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>"text"[]</>)</function></literal>
</entry>
<entry><type>tsvector</type></entry>
<entry>assign <replaceable class="PARAMETER">weight</replaceable> to elements of <replaceable class="PARAMETER">vector</replaceable> that are listed in <replaceable class="PARAMETER">lexemes</replaceable> array</entry>
- <entry><literal>setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A', '{cat,rat}')</literal></entry>
+ <entry><literal>ts_setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A', '{cat,rat}')</literal></entry>
<entry><literal>'cat':3A 'fat':2,4 'rat':5A</literal></entry>
</row>
<row>
@@ -9289,37 +9289,37 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
<row>
<entry>
<indexterm>
- <primary>delete</primary>
- <secondary>delete lexeme(s) from tsvector</secondary>
+ <primary>ts_delete</primary>
+ <secondary>ts_delete lexeme(s) from tsvector</secondary>
</indexterm>
- <literal><function>delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexeme</replaceable> <type>text</>)</function></literal>
+ <literal><function>ts_delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexeme</replaceable> <type>text</>)</function></literal>
</entry>
<entry><type>tsvector</type></entry>
<entry>remove given <replaceable class="PARAMETER">lexeme</replaceable> from <replaceable class="PARAMETER">vector</replaceable></entry>
- <entry><literal>delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat')</literal></entry>
+ <entry><literal>ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat')</literal></entry>
<entry><literal>'cat':3 'rat':5A</literal></entry>
</row>
<row>
<entry>
<!-- previous indexterm entry covers this too -->
- <literal><function>delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>text[]</>)</function></literal>
+ <literal><function>ts_delete(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">lexemes</replaceable> <type>text[]</>)</function></literal>
</entry>
<entry><type>tsvector</type></entry>
<entry>remove any occurrence of lexemes in <replaceable class="PARAMETER">lexemes</replaceable> array from <replaceable class="PARAMETER">vector</replaceable></entry>
- <entry><literal>delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat'])</literal></entry>
+ <entry><literal>ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat'])</literal></entry>
<entry><literal>'cat':3</literal></entry>
</row>
<row>
<entry>
<indexterm>
- <primary>unnest</primary>
+ <primary>ts_unnest</primary>
<secondary>for tsvector</secondary>
</indexterm>
- <literal><function>unnest(<type>tsvector</>, OUT <replaceable class="PARAMETER">lexeme</> <type>text</>, OUT <replaceable class="PARAMETER">positions</> <type>smallint[]</>, OUT <replaceable class="PARAMETER">weights</> <type>text</>)</function></literal>
+ <literal><function>ts_unnest(<type>tsvector</>, OUT <replaceable class="PARAMETER">lexeme</> <type>text</>, OUT <replaceable class="PARAMETER">positions</> <type>smallint[]</>, OUT <replaceable class="PARAMETER">weights</> <type>text</>)</function></literal>
</entry>
<entry><type>setof record</type></entry>
<entry>expand a tsvector to a set of rows</entry>
- <entry><literal>unnest('fat:2,4 cat:3 rat:5A'::tsvector)</literal></entry>
+ <entry><literal>ts_unnest('fat:2,4 cat:3 rat:5A'::tsvector)</literal></entry>
<entry><literal>(cat,{3},{D}) ...</literal></entry>
</row>
<row>
@@ -9349,14 +9349,14 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
<row>
<entry>
<indexterm>
- <primary>filter</primary>
+ <primary>ts_filter</primary>
<secondary>for tsvector</secondary>
</indexterm>
- <literal><function>filter(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weights</replaceable> <type>"char"[]</>)</function></literal>
+ <literal><function>ts_filter(<replaceable class="PARAMETER">vector</replaceable> <type>tsvector</>, <replaceable class="PARAMETER">weights</replaceable> <type>"char"[]</>)</function></literal>
</entry>
<entry><type>tsvector</type></entry>
<entry>Select only elements with given <replaceable class="PARAMETER">weights</replaceable> from <replaceable class="PARAMETER">vector</replaceable></entry>
- <entry><literal>filter('fat:2,4 cat:3b rat:5A'::tsvector, '{a,b}')</literal></entry>
+ <entry><literal>ts_filter('fat:2,4 cat:3b rat:5A'::tsvector, '{a,b}')</literal></entry>
<entry><literal>'cat':3B 'rat':5A</literal></entry>
</row>
<row>
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 021ba50..8ed1a22 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -4534,22 +4534,22 @@ DATA(insert OID = 3711 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2
DESCR("number of lexemes");
DATA(insert OID = 3623 ( strip PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 3614 "3614" _null_ _null_ _null_ _null_ _null_ tsvector_strip _null_ _null_ _null_ ));
DESCR("strip position information");
-DATA(insert OID = 3624 ( setweight PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 3614 "3614 18" _null_ _null_ _null_ _null_ _null_ tsvector_setweight _null_ _null_ _null_ ));
+DATA(insert OID = 3624 ( ts_setweight PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 3614 "3614 18" _null_ _null_ _null_ _null_ _null_ tsvector_setweight _null_ _null_ _null_ ));
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_ ));
+DATA(insert OID = 3320 ( ts_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_ ));
+DATA(insert OID = 3322 ( ts_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");
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_ ));
+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("returns tsvector that contain only postings with 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_ ));
diff --git a/src/test/regress/expected/tstypes.out b/src/test/regress/expected/tstypes.out
index c8ca062..c0bc723 100644
--- a/src/test/regress/expected/tstypes.out
+++ b/src/test/regress/expected/tstypes.out
@@ -979,76 +979,76 @@ 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
+SELECT ts_unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
+ ts_unnest
---------------------------------------------
(base,{7},{D})
(hidden,{6},{D})
@@ -1057,8 +1057,8 @@ SELECT unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::ts
(strike,{3},{D})
(5 rows)
-SELECT unnest('base hidden rebel spaceship strike'::tsvector);
- unnest
+SELECT ts_unnest('base hidden rebel spaceship strike'::tsvector);
+ ts_unnest
---------------
(base,,)
(hidden,,)
@@ -1067,7 +1067,7 @@ SELECT unnest('base hidden rebel spaceship strike'::tsvector);
(strike,,)
(5 rows)
-SELECT * FROM unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
+SELECT * FROM ts_unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
lexeme | positions | weights
-----------+-----------------+-------------
base | {7} | {D}
@@ -1077,7 +1077,7 @@ SELECT * FROM unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike
strike | {3} | {D}
(5 rows)
-SELECT * FROM unnest('base hidden rebel spaceship strike'::tsvector);
+SELECT * FROM ts_unnest('base hidden rebel spaceship strike'::tsvector);
lexeme | positions | weights
-----------+-----------+---------
base | |
@@ -1087,7 +1087,7 @@ SELECT * FROM unnest('base hidden rebel spaceship strike'::tsvector);
strike | |
(5 rows)
-SELECT lexeme, positions[1] from unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
+SELECT lexeme, positions[1] from ts_unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
lexeme | positions
-----------+-----------
base | 7
@@ -1117,55 +1117,55 @@ SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship','strike']);
SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship', NULL]);
ERROR: lexeme array may not contain nulls
-SELECT setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
- setweight
+SELECT ts_setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
+ ts_setweight
----------------------------------------------------------
'a':1C,3C 'asd':1C 'w':5C,6C,12C,13C 'zxc':81C,222C,567C
(1 row)
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c');
- setweight
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c');
+ ts_setweight
----------------------------------------------------------
'a':1C,3C 'asd':1C 'w':5C,6C,12C,13C 'zxc':81C,222C,567C
(1 row)
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
- setweight
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
+ ts_setweight
------------------------------------------------------
'a':1C,3C 'asd':1C 'w':5,6,12B,13A 'zxc':81,222A,567
(1 row)
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
- setweight
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
+ ts_setweight
------------------------------------------------------
'a':1C,3C 'asd':1C 'w':5,6,12B,13A 'zxc':81,222A,567
(1 row)
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a,zxc}');
- setweight
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a,zxc}');
+ ts_setweight
--------------------------------------------------------
'a':1C,3C 'asd':1C 'w':5,6,12B,13A 'zxc':81C,222C,567C
(1 row)
-SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
- setweight
+SELECT ts_setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
+ ts_setweight
---------------------------------
'a' 'asd' 'w':5,6,12B,13A 'zxc'
(1 row)
-SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', ARRAY['a', 'zxc', NULL]);
+SELECT ts_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
diff --git a/src/test/regress/sql/tstypes.sql b/src/test/regress/sql/tstypes.sql
index ecc71c8..927a42a 100644
--- a/src/test/regress/sql/tstypes.sql
+++ b/src/test/regress/sql/tstypes.sql
@@ -193,25 +193,25 @@ 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 unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
-SELECT unnest('base hidden rebel spaceship strike'::tsvector);
-SELECT * FROM unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
-SELECT * FROM unnest('base hidden rebel spaceship strike'::tsvector);
-SELECT lexeme, positions[1] from unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
+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 ts_unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
+SELECT ts_unnest('base hidden rebel spaceship strike'::tsvector);
+SELECT * FROM ts_unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
+SELECT * FROM ts_unnest('base hidden rebel spaceship strike'::tsvector);
+SELECT lexeme, positions[1] from ts_unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT tsvector_to_array('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT tsvector_to_array('base hidden rebel spaceship strike'::tsvector);
@@ -219,14 +219,14 @@ SELECT tsvector_to_array('base hidden rebel spaceship strike'::tsvector);
SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship','strike']);
SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship', NULL]);
-SELECT setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c');
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
-SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a,zxc}');
-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_setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c');
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
+SELECT ts_setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a,zxc}');
+SELECT ts_setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
+SELECT ts_setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', ARRAY['a', 'zxc', 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}');
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
@ 2016-05-04 17:15 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
0 siblings, 1 reply; 15+ messages in thread
From: Tom Lane @ 2016-05-04 17:15 UTC (permalink / raw)
To: Stas Kelvich <s.kelvich@postgrespro.ru>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>> On 04 May 2016, at 16:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The other ones are not so problematic because they do not conflict with
>> SQL keywords. It's only delete() and filter() that scare me.
> Okay, so changed functions to ts_setweight, ts_delete, ts_unnest, ts_filter.
Somehow, I don't think you read what I wrote.
Renaming the pre-existing setweight() function to ts_setweight() is
not going to happen; it's been like that for half a dozen years now.
It would make no sense to call the new variant ts_setweight() while
keeping setweight() for the existing function, either.
I also don't see that much point in ts_unnest(), since unnest()
in our implementation is a function not a keyword. I don't have
a strong opinion about that one, though.
Also, I'd supposed that we'd rename to tsvector_something, since
the same patch also introduced tsvector_to_array() and
array_to_tsvector(). What's the motivation for using ts_ as the
prefix?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-05 09:20 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 10:31 ` Re: Naming of new tsvector functions Gavin Flower <GavinFlower@archidevsys.co.nz>
2016-05-05 19:44 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 15+ messages in thread
From: Stas Kelvich @ 2016-05-05 09:20 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
> On 04 May 2016, at 20:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>>> On 04 May 2016, at 16:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> The other ones are not so problematic because they do not conflict with
>>> SQL keywords. It's only delete() and filter() that scare me.
>
>> Okay, so changed functions to ts_setweight, ts_delete, ts_unnest, ts_filter.
>
> Somehow, I don't think you read what I wrote.
>
> Renaming the pre-existing setweight() function to ts_setweight() is
> not going to happen; it's been like that for half a dozen years now.
> It would make no sense to call the new variant ts_setweight() while
> keeping setweight() for the existing function, either.
Oh, I accidentally renamed one of the old functions, my mistake.
> I also don't see that much point in ts_unnest(), since unnest()
> in our implementation is a function not a keyword. I don't have
> a strong opinion about that one, though.
Just to keep some level of uniformity in function names. But also i’m
not insisting.
> Also, I'd supposed that we'd rename to tsvector_something, since
> the same patch also introduced tsvector_to_array() and
> array_to_tsvector(). What's the motivation for using ts_ as the
> prefix?
There is already several functions named ts_* (ts_rank, ts_headline, ts_rewrite)
and two named starting from tsvector_* (tsvector_update_trigger, tsvector_update_trigger_column).
Personally I’d prefer ts_ over tsvector_ since it is shorter, and still keeps semantics.
>
> regards, tom lane
--
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
@ 2016-05-05 10:31 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
1 sibling, 0 replies; 15+ messages in thread
From: Gavin Flower @ 2016-05-05 10:31 UTC (permalink / raw)
To: Stas Kelvich <s.kelvich@postgrespro.ru>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
On 05/05/16 21:20, Stas Kelvich wrote:
>> On 04 May 2016, at 20:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>>>> On 04 May 2016, at 16:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> The other ones are not so problematic because they do not conflict with
>>>> SQL keywords. It's only delete() and filter() that scare me.
>>> Okay, so changed functions to ts_setweight, ts_delete, ts_unnest, ts_filter.
>> Somehow, I don't think you read what I wrote.
>>
>> Renaming the pre-existing setweight() function to ts_setweight() is
>> not going to happen; it's been like that for half a dozen years now.
>> It would make no sense to call the new variant ts_setweight() while
>> keeping setweight() for the existing function, either.
> Oh, I accidentally renamed one of the old functions, my mistake.
>
>> I also don't see that much point in ts_unnest(), since unnest()
>> in our implementation is a function not a keyword. I don't have
>> a strong opinion about that one, though.
> Just to keep some level of uniformity in function names. But also i’m
> not insisting.
>
>> Also, I'd supposed that we'd rename to tsvector_something, since
>> the same patch also introduced tsvector_to_array() and
>> array_to_tsvector(). What's the motivation for using ts_ as the
>> prefix?
> There is already several functions named ts_* (ts_rank, ts_headline, ts_rewrite)
> and two named starting from tsvector_* (tsvector_update_trigger, tsvector_update_trigger_column).
>
> Personally I’d prefer ts_ over tsvector_ since it is shorter, and still keeps semantics.
>
>> regards, tom lane
>
I've not been involved in doing any tsvector stuff, nor likely to in the
near future - but if i was, I think I'd find simpler to get into if
tsvector specific functions followed a common pattern of naming, like
Stas is suggesting.
Cheers,
Gavin
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
@ 2016-05-05 19:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 21:46 ` Re: Naming of new tsvector functions Gavin Flower <GavinFlower@archidevsys.co.nz>
1 sibling, 1 reply; 15+ messages in thread
From: Tom Lane @ 2016-05-05 19:44 UTC (permalink / raw)
To: Stas Kelvich <s.kelvich@postgrespro.ru>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>> On 04 May 2016, at 20:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Also, I'd supposed that we'd rename to tsvector_something, since
>> the same patch also introduced tsvector_to_array() and
>> array_to_tsvector(). What's the motivation for using ts_ as the
>> prefix?
> There is already several functions named ts_* (ts_rank, ts_headline, ts_rewrite)
> and two named starting from tsvector_* (tsvector_update_trigger, tsvector_update_trigger_column).
> Personally I’d prefer ts_ over tsvector_ since it is shorter, and still keeps semantics.
Yeah, I see we're already a bit inconsistent here. The problem with using
a ts_ prefix, to my mind, is that it offers no option for distinguishing
tsvector from tsquery, should you need to do that. Maybe this isn't a
problem for functions that have tsvector as input.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 19:44 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-05 21:46 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
2016-05-05 22:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
0 siblings, 1 reply; 15+ messages in thread
From: Gavin Flower @ 2016-05-05 21:46 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Stas Kelvich <s.kelvich@postgrespro.ru>; +Cc: David Fetter <david@fetter.org>; pgsql-hackers
On 06/05/16 07:44, Tom Lane wrote:
> Stas Kelvich <s.kelvich@postgrespro.ru> writes:
>>> On 04 May 2016, at 20:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Also, I'd supposed that we'd rename to tsvector_something, since
>>> the same patch also introduced tsvector_to_array() and
>>> array_to_tsvector(). What's the motivation for using ts_ as the
>>> prefix?
>> There is already several functions named ts_* (ts_rank, ts_headline, ts_rewrite)
>> and two named starting from tsvector_* (tsvector_update_trigger, tsvector_update_trigger_column).
>> Personally Iâd prefer ts_ over tsvector_ since it is shorter, and still keeps semantics.
> Yeah, I see we're already a bit inconsistent here. The problem with using
> a ts_ prefix, to my mind, is that it offers no option for distinguishing
> tsvector from tsquery, should you need to do that. Maybe this isn't a
> problem for functions that have tsvector as input.
>
> regards, tom lane
>
>
use tsv_ and tsq_?
Cheers,
Gavin
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 19:44 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 21:46 ` Re: Naming of new tsvector functions Gavin Flower <GavinFlower@archidevsys.co.nz>
@ 2016-05-05 22:25 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 23:04 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 15+ messages in thread
From: Stas Kelvich @ 2016-05-05 22:25 UTC (permalink / raw)
To: Gavin Flower <GavinFlower@archidevsys.co.nz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David Fetter <david@fetter.org>; pgsql-hackers
> On 06 May 2016, at 00:46, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:
>
> On 06/05/16 07:44, Tom Lane wrote:
>>
>> Yeah, I see we're already a bit inconsistent here. The problem with using
>> a ts_ prefix, to my mind, is that it offers no option for distinguishing
>> tsvector from tsquery, should you need to do that. Maybe this isn't a
>> problem for functions that have tsvector as input.
>>
>> regards, tom lane
>>
>>
> use tsv_ and tsq_?
>
>
> Cheers,
> Gavin
>
That would be a good convention if we were able to easily rename old functions.
But now that will just create another pattern on top of three existing (no prefix, ts_*, tsvector_*).
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Naming of new tsvector functions
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 21:59 ` Re: Naming of new tsvector functions David Fetter <david@fetter.org>
2016-05-04 13:43 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 19:44 ` Re: Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 21:46 ` Re: Naming of new tsvector functions Gavin Flower <GavinFlower@archidevsys.co.nz>
2016-05-05 22:25 ` Re: Naming of new tsvector functions Stas Kelvich <s.kelvich@postgrespro.ru>
@ 2016-05-05 23:04 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 15+ messages in thread
From: Tom Lane @ 2016-05-05 23:04 UTC (permalink / raw)
To: Stas Kelvich <s.kelvich@postgrespro.ru>; +Cc: Gavin Flower <GavinFlower@archidevsys.co.nz>; David Fetter <david@fetter.org>; pgsql-hackers
Stas Kelvich <s.kelvich@postgrespro.ru> writes:
> On 06 May 2016, at 00:46, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:
>> On 06/05/16 07:44, Tom Lane wrote:
>>> Yeah, I see we're already a bit inconsistent here. The problem with using
>>> a ts_ prefix, to my mind, is that it offers no option for distinguishing
>>> tsvector from tsquery, should you need to do that. Maybe this isn't a
>>> problem for functions that have tsvector as input.
>> use tsv_ and tsq_?
> That would be a good convention if we were able to easily rename old functions.
> But now that will just create another pattern on top of three existing (no prefix, ts_*, tsvector_*).
Yeah :-(. Well, time grows short, so let's go with ts_ for these.
I'll go make it happen.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 15+ messages in thread
end of thread, other threads:[~2016-05-05 23:04 UTC | newest]
Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-02 17:27 Naming of new tsvector functions Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 17:31 ` Joshua D. Drake <jd@commandprompt.com>
2016-05-02 17:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-02 18:24 ` Robert Haas <robertmhaas@gmail.com>
2016-05-02 21:59 ` David Fetter <david@fetter.org>
2016-05-04 13:43 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 13:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-04 16:25 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-04 17:15 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 09:20 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 10:31 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
2016-05-05 19:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-05 21:46 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
2016-05-05 22:25 ` Stas Kelvich <s.kelvich@postgrespro.ru>
2016-05-05 23:04 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox