Re: Question with tsearch2 (or it might be a general one

Поиск
Список
Период
Сортировка
От Chris
Тема Re: Question with tsearch2 (or it might be a general one
Дата
Msg-id 453C5082.4060208@gmail.com
обсуждение исходный текст
Ответ на Question with tsearch2 (or it might be a general one too)  (Ritesh Nadhani <ritesh-nadhani@uiowa.edu>)
Список pgsql-general
Ritesh Nadhani wrote:
> Hello
>
> A newbie to PostgreSQL from MySQL and just trying to learn tsearch2. In
> one of the examples at:
>
> http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro.html
>
>
> the query given is:
>
> SELECT intindex, strTopic FROM tblmessages
>                 WHERE idxfti @@ to_tsquery('default', 'gettysburg &
> address')
>                 AND strMessage ~* '.*men are created equal.*';
>
> What does the '@@' in the query means?

It is specific to tsearch2 and it tells postgres how to do the
comparison between the two items - much the same as '=' or '>' do.

If you log in to psql and do:

\do @@

It will list all '@@' operators and show you what data etc it will be
expecting in each case (each operator can be used in a different context
depending on what type of data you're using).

If you really want to look at what it does, look at the tsearch2 source
code, it'd be in there somewhere (grep for 'create operator' and go from
there).

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to find out about zlib compression
Следующее
От: Joost Kraaijeveld
Дата:
Сообщение: How to determine initdb parameters on old database?