Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7B3F563345E; Thu, 29 Apr 2010 11:01:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 93893-04; Thu, 29 Apr 2010 14:01:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 552986329E5; Thu, 29 Apr 2010 11:01:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3TE1V6t010740; Thu, 29 Apr 2010 10:01:31 -0400 (EDT) To: "sandeep prakash dhumale" cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: =?utf-8?B?VHNlYXJjaCBub3Qgc2VhcmNoaW5nICdZJw==?= In-reply-to: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> References: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> Comments: In-reply-to "sandeep prakash dhumale" message dated "29 Apr 2010 13:13:40 -0000" Date: Thu, 29 Apr 2010 10:01:31 -0400 Message-ID: <10739.1272549691@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.838 tagged_above=-10 required=5 tests=AWL=0.072, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/1074 X-Sequence-Number: 162272 "sandeep prakash dhumale" writes: > I am trying to get tsearch working for my application but I am facing a > problem when alphabet 'Y' is the in the tsquery. > # SELECT 'hollywood'::tsvector @@ to_tsquery('holly:*'); > ?column? > ---------- > f > (1 row) You can't use to_tsquery for this sort of thing, because it tries to normalize the given words: regression=# select to_tsquery('holly:*'); to_tsquery ------------ 'holli':* (1 row) If you do this it works: regression=# SELECT 'hollywood'::tsvector @@ 'holly:*'::tsquery; ?column? ---------- t (1 row) So if you want to use prefix matching, don't normalize. regards, tom lane