Commit a7ace3b6 authored by Teodor Sigaev's avatar Teodor Sigaev

Make testing of phraseto_tsquery independ from value of

default_text_search_config variable.

Per skink buldfarm member
parent fcff8a57
...@@ -759,25 +759,25 @@ SELECT to_tsquery('english', '2 <-> (s <-> (1 <-> a))'); ...@@ -759,25 +759,25 @@ SELECT to_tsquery('english', '2 <-> (s <-> (1 <-> a))');
'2' <-> '1' '2' <-> '1'
(1 row) (1 row)
SELECT to_tsquery('foo <-> (a <-> (the <-> bar))'); SELECT to_tsquery('english', 'foo <-> (a <-> (the <-> bar))');
to_tsquery to_tsquery
----------------- -----------------
'foo' <-> 'bar' 'foo' <-> 'bar'
(1 row) (1 row)
SELECT to_tsquery('((foo <-> a) <-> the) <-> bar'); SELECT to_tsquery('english', '((foo <-> a) <-> the) <-> bar');
to_tsquery to_tsquery
----------------- -----------------
'foo' <3> 'bar' 'foo' <3> 'bar'
(1 row) (1 row)
SELECT to_tsquery('foo <-> a <-> the <-> bar'); SELECT to_tsquery('english', 'foo <-> a <-> the <-> bar');
to_tsquery to_tsquery
----------------- -----------------
'foo' <3> 'bar' 'foo' <3> 'bar'
(1 row) (1 row)
SELECT phraseto_tsquery('PostgreSQL can be extended by the user in many ways'); SELECT phraseto_tsquery('english', 'PostgreSQL can be extended by the user in many ways');
phraseto_tsquery phraseto_tsquery
----------------------------------------------------------------------- -----------------------------------------------------------------------
( ( ( 'postgresql' <3> 'extend' ) <3> 'user' ) <2> 'mani' ) <-> 'way' ( ( ( 'postgresql' <3> 'extend' ) <3> 'user' ) <2> 'mani' ) <-> 'way'
...@@ -1462,7 +1462,7 @@ create temp table phrase_index_test(fts tsvector); ...@@ -1462,7 +1462,7 @@ create temp table phrase_index_test(fts tsvector);
insert into phrase_index_test values('A fat cat has just eaten a rat.'); insert into phrase_index_test values('A fat cat has just eaten a rat.');
create index phrase_index_test_idx on phrase_index_test using gin(fts); create index phrase_index_test_idx on phrase_index_test using gin(fts);
set enable_seqscan = off; set enable_seqscan = off;
select * from phrase_index_test where fts @@ phraseto_tsquery('fat cat'); select * from phrase_index_test where fts @@ phraseto_tsquery('english', 'fat cat');
fts fts
------------------------------------------------- -------------------------------------------------
'A' 'a' 'cat' 'eaten' 'fat' 'has' 'just' 'rat.' 'A' 'a' 'cat' 'eaten' 'fat' 'has' 'just' 'rat.'
......
...@@ -169,10 +169,10 @@ SELECT to_tsquery('english', '2 <-> (s <-> (a <-> 1))'); ...@@ -169,10 +169,10 @@ SELECT to_tsquery('english', '2 <-> (s <-> (a <-> 1))');
SELECT to_tsquery('english', '2 <-> ((1 <-> a) <-> s)'); SELECT to_tsquery('english', '2 <-> ((1 <-> a) <-> s)');
SELECT to_tsquery('english', '2 <-> (s <-> (1 <-> a))'); SELECT to_tsquery('english', '2 <-> (s <-> (1 <-> a))');
SELECT to_tsquery('foo <-> (a <-> (the <-> bar))'); SELECT to_tsquery('english', 'foo <-> (a <-> (the <-> bar))');
SELECT to_tsquery('((foo <-> a) <-> the) <-> bar'); SELECT to_tsquery('english', '((foo <-> a) <-> the) <-> bar');
SELECT to_tsquery('foo <-> a <-> the <-> bar'); SELECT to_tsquery('english', 'foo <-> a <-> the <-> bar');
SELECT phraseto_tsquery('PostgreSQL can be extended by the user in many ways'); SELECT phraseto_tsquery('english', 'PostgreSQL can be extended by the user in many ways');
SELECT ts_rank_cd(to_tsvector('english', ' SELECT ts_rank_cd(to_tsvector('english', '
...@@ -485,5 +485,5 @@ create temp table phrase_index_test(fts tsvector); ...@@ -485,5 +485,5 @@ create temp table phrase_index_test(fts tsvector);
insert into phrase_index_test values('A fat cat has just eaten a rat.'); insert into phrase_index_test values('A fat cat has just eaten a rat.');
create index phrase_index_test_idx on phrase_index_test using gin(fts); create index phrase_index_test_idx on phrase_index_test using gin(fts);
set enable_seqscan = off; set enable_seqscan = off;
select * from phrase_index_test where fts @@ phraseto_tsquery('fat cat'); select * from phrase_index_test where fts @@ phraseto_tsquery('english', 'fat cat');
set enable_seqscan = on; set enable_seqscan = on;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment