Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9DCD3632D4D for ; Wed, 7 Jul 2010 17:41:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 47545-01 for ; Wed, 7 Jul 2010 20:41:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 4B9C06345CA for ; Wed, 7 Jul 2010 17:41:25 -0300 (ADT) Received: by vws5 with SMTP id 5so101731vws.19 for ; Wed, 07 Jul 2010 13:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=dMi1hteMT3NudmuyQgL6ESo92Q03pu+mKZ+mS7nFE1E=; b=hpgXy8fKgb7DfgFBUrQczvHF9Gxb9Tq9J6NOjwstD5ATqEPjE+xQl5ZOQAtyv+4AMS J6oLnY2tNO4QJTXuXqSeWMXRB2hESMCrg0f0Hk8aW81bNv1+kHkWKPvMugu7o0WUM+aZ /78/+krrGtIZtAenrv/1jEGyyab7A4UPmMJQ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Od1pgFyaRk9eWjA/PwsyUEsFk8j6ofngpycLtHr5XaaKNaFsVGehj35nbmnKYVKNMl WEChPRJ712SmxqtmZm0Sw0btUyxsHfJv1H+ttDZv1fQbDnAsSr/o+6mpD6MgvGWAwoP/ dL1DjPd3zixat6FBRJr3d90CxEl0TkQeumQlo= MIME-Version: 1.0 Received: by 10.220.62.5 with SMTP id v5mr3598516vch.221.1278535284002; Wed, 07 Jul 2010 13:41:24 -0700 (PDT) Received: by 10.220.178.131 with HTTP; Wed, 7 Jul 2010 13:41:23 -0700 (PDT) Date: Wed, 7 Jul 2010 15:41:23 -0500 Message-ID: Subject: tsearch2 and wildcards/pattern matching? From: Peter Koczan To: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-5 required=5 tests=BAYES_20=-0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201007/32 X-Sequence-Number: 34345 Hi all, Is there any sort of pattern matching or partial matching capability in tsearch2? I'd like to be able search for a common prefix (like for order numbers). For instance, tsearch2 will index 'zvt123456' or 'zvt555555', but I'd like to be able to find both of them in one query using something akin to 'zvt%', like select * from attachments where textsearchable @@ 'zvt%'; I've been unable to find anything in documentation. If there's anything in tsearch2 that can do this and is faster than LIKE clauses on full-text, that would be fantastic. Cheers, Peter