Re: Problem with index using regular expression - Mailing list psycopg

From Federico Di Gregorio
Subject Re: Problem with index using regular expression
Date
Msg-id 4DEC7CC6.2070007@dndg.it
Whole thread Raw
In response to Re: Problem with index using regular expression  (Håvard Wahl Kongsgård <haavard.kongsgaard@gmail.com>)
Responses Re: Problem with index using regular expression  (Alejandro Dubrovsky <alex.dubrovsky@hitwise.com>)
List psycopg
On 06/06/11 09:03, Håvard Wahl Kongsgård wrote:
> substring(nodes.name <http://nodes.name> from
> E'\\w.*\\s(\\w.*)$|\\w+\\s(\\w.*)$') = substring(income.name
> <http://income.name> from E'\\w.*\\s(\\w.*)$|\\w+\\s(\\w.*)$') limit 1000")

Try doubling every '\' because that's a Python escape character too and
you want to send to the database the "\\X" sequence, not "\X"; i.e.,

... from E'\\\\w.*\\\\s(\\\\w.*)$|\\\\w+\\\\s(\\\\w.*)$') ...

Hope this helps,
federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
Studio Associato Di Nunzio e Di Gregorio                  http://dndg.it
  Qu'est ce que la folie? Juste un sentiment de liberté si
   fort qu'on en oublie ce qui nous rattache au monde... -- J. de Loctra

psycopg by date:

Previous
From: Håvard Wahl Kongsgård
Date:
Subject: Re: Problem with index using regular expression
Next
From: Alejandro Dubrovsky
Date:
Subject: Re: Problem with index using regular expression