Index to support LIKE '%suffix' queries

From: Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Index to support LIKE '%suffix' queries
Date: 2006-02-25 14:17:41
Message-ID: 87mzgfh69m.fsf@mid.deneb.enyo.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is it possible to create an index to support queries of the form
"column LIKE '%suffix'" (similar to an ordinary index for LIKE
'prefix%', which I also need)?

I could define a function which reverts strings (or revert them in the
application) and use a normal B-tree index, but I wonder if there is a
better way.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2006-02-25 14:40:44 Re: After Trigger assignment to NEW
Previous Message Richard C 2006-02-25 10:42:57 Re: "Installing" dbLink