websearch_to_tsquery() and apostrophe inside double quotes

Поиск
Список
Период
Сортировка
От Alastair McKinley
Тема websearch_to_tsquery() and apostrophe inside double quotes
Дата
Msg-id DB6PR0202MB29042F00F80B87CE187BD2B6E3940@DB6PR0202MB2904.eurprd02.prod.outlook.com
обсуждение исходный текст
Ответы Re: websearch_to_tsquery() and apostrophe inside double quotes
Список pgsql-general
Hi all,

I am a little confused about what us being generated by websearch_to_tsquery() in the case of an apostrophe inside double quotes.

Here is an example of searching for a name containing an apostrophe.

The following works as expected:

select to_tsvector('peter o''toole') @@ websearch_to_tsquery('peter o''toole');
 ?column?
----------
 t
(1 row)


When the name is in double quotes, the search fails:

select to_tsvector('peter o''toole') @@ websearch_to_tsquery('"peter o''toole"');
 ?column?
----------
 f
(1 row)

In the first case, websearch_to_tsquery() returns:

select websearch_to_tsquery('peter o''toole');
  websearch_to_tsquery  
------------------------
 'peter' & 'o' & 'tool'
(1 row)

which makes sense to me.

In the second case websearch_to_tsquery() returns something that I can't quite understand:

select websearch_to_tsquery('"peter o''toole"');
     websearch_to_tsquery    
------------------------------
 'peter' <-> ( 'o' & 'tool' )
(1 row)

I am not quite sure what text this will actually match?

Best regards,

Alastair


В списке pgsql-general по дате отправления:

Предыдущее
От: Timmy Siu
Дата:
Сообщение: Minimum privilege for Backup and replication
Следующее
От: Luca Ferrari
Дата:
Сообщение: Re: Minimum privilege for Backup and replication