is this the correct result for ts_rewrite? reducing tsquery to improve performance? - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject is this the correct result for ts_rewrite? reducing tsquery to improve performance?
Date
Msg-id 20100129021404.279bbfe2@dawn.webthatworks.it
Whole thread Raw
List pgsql-general
select ts_rewrite(
  to_tsquery('java:A & cola & java:AB'),
  'java:AB'::tsquery,
  'java:AB'::tsquery);

ts_rewrite
--------------------------------
 'cola' & 'java':AB & 'java':AB

Is this the expected (documented) result?

I found this while looking for a way to build up a tsquery directly
in it's own structure without passing through its text
representation (and maybe reduce it).

The following looks equivalent. Are they?

test=# select 'java:ABC'::tsquery;
  tsquery
------------
 'java':ABC
(1 row)

test=# select 'java:A | java:B | java:C'::tsquery;
              tsquery
------------------------------------
 ( 'java':A | 'java':B ) | 'java':C
(1 row)

I did try to pass them through nodetree... but the result keeps on
being different.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: how to update a view from a table
Next
From: 沈雷
Date:
Subject: Output float number with hex format