Re: Creating an index-type for LIKE '%value%'

From: "Larry Rosenman" <ler(at)lerctr(dot)org>
To: "'Oleg Bartunov'" <oleg(at)sai(dot)msu(dot)su>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Creating an index-type for LIKE '%value%'
Date: 2005-02-08 15:11:21
Message-ID: E1CyX2G-0005E2-5f@lerami.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oleg Bartunov wrote:
> On Tue, 8 Feb 2005, Larry Rosenman wrote:
>
>> On Tue, 8 Feb 2005, Oleg Bartunov wrote:
>>
>>> On Mon, 7 Feb 2005, Larry Rosenman wrote:
>>>
>>>> Oleg Bartunov wrote:
>>>
>>> Larry, I pointed you to pg_trgm module mostly following Martijn's
>>> suggestions. Now, I see you need another our module - ltree, see
>>> http://www.sai.msu.su/~megera/postgres/gist/ltree/
>>> for details.
>>
>> I maybe dense, but could you give me an example?
>
> test=# \d tt
> Table "public.tt"
> Column | Type | Modifiers
> --------+-------+-----------
> domain | ltree |
> Indexes:
> "ltree_idx" gist ("domain")
>
> test=# select * from tt where domain ~ '*.ru'::lquery;
> domain
> -------------
> astronet.ru
> mail.ru
> pgsql.ru
> (3 rows)
>
>
>>
>> I'm not seeing it for some reason :).
>>
>> Thanks,
>> LER
>>
>>
>
> Regards,
> Oleg
> _____________________________________________________________
> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
> Sternberg Astronomical Institute, Moscow University (Russia)
> Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
> phone: +007(095)939-16-83, +007(095)939-23-83

It doesn't seem to like pieces with hyphens ('-') in the name, when I try
To update blacklist set new_domain_lt=text2ltree(domain) I get a
Syntax error (apparently for the hyphens).

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Berend Tober 2005-02-08 15:14:56 Re: Sorting when '*' is the initial character - solved
Previous Message Berend Tober 2005-02-08 15:05:20 Re: Problem performing a restore of a data schema in Wi