pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Emils Klotins <emils@grafton.lv>
To: pgsql-sql@postgresql.org
Subject: Regexps -- too complex?
Date: Thu, 26 Apr 2001 12:54:19 +0200
Message-ID: <3AE81A7B.2506.E8EB40C@localhost> (raw)

Running 7.0.2 on Alpha/RedHat 6.2 256MB RAM

In order to implement a fulltext search, I have a func that parses list 
of words and creates a regexp query with things like [[:<:]]( word | 
word | ... )[[:>:]]

That query then is passed to backend...

Now the strange thing:

gamenet=# SELECT id, title,publishdate,categoryid FROM articles WHERE translate(title,'abcdefghijklmnopqrstuvwxyzâèçìîíïòðûþõäöü','ABCDEFGHIJKLMNOPQRSTUVWXYZÂÈÇÌÎÍÏÒÐÛÞÕÄÖÜ') ~ '(BLACK|SERIOUS|SAM)[[:>:]]'::text ;
  id  |                      title                      | publishdate | categoryid
------+-------------------------------------------------+-------------+------------
  600 | Serious Sam ceïâ pie pircçjiem                  | 2001-03-22  |        149
  523 | Black & White gaidîðanas svçtki                 | 2001-03-19  |        155
  241 | Lorgaine: The Black Standard - íeltu varoòeposs | 2001-02-27  |        155
  707 | Lorgaine: The Black Standard beta versija       | 2001-03-23  |        156
 1484 | Black&White tomçr neesot spiegu programma   | 2001-04-18  |        155
 1490 | Black & White FAQ                               | 2001-04-18  |        160
 1496 | Black & White "ïaunais" FAQ                     | 2001-04-18  |        160
 1732 | Black & White - pârdotâkâ spçle ASV             | 2001-04-24  |        155
(8 rows)


gamenet=# SELECT id, title,publishdate,categoryid FROM articles WHERE translate(title,'abcdefghijklmnopqrstuvwxyzâèçìîíïòðûþõäöü','ABCDEFGHIJKLMNOPQRSTUVWXYZÂÈÇÌÎÍÏÒÐÛÞÕÄÖÜ') ~ '(BLACK|SERIOUS|WHITE|SAM)[[:>:]]'::text ;
 id | title | publishdate | categoryid
----+-------+-------------+------------
(0 rows)


It seems that if the regexp is too complex (more than 3 |-ed 
elements) it doesnt return.

Any ideas?




view thread (3+ messages)  latest in thread

Message-ID: <3AE81A7B.2506.E8EB40C@localhost>
Permalink:  ../3AE81A7B.2506.E8EB40C@localhost/
Also on:    postgresql.org/message-id/3AE81A7B.2506.E8EB40C@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: emils@grafton.lv
  Subject: Re: Regexps -- too complex?
  In-Reply-To: <3AE81A7B.2506.E8EB40C@localhost>
  References: <3AE81A7B.2506.E8EB40C@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox