Re: Problem with index using regular expression

From: Federico Di Gregorio <federico(dot)digregorio(at)dndg(dot)it>
To: Håvard Wahl Kongsgård <haavard(dot)kongsgaard(at)gmail(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Problem with index using regular expression
Date: 2011-06-06 07:07:50
Message-ID: 4DEC7CC6.2070007@dndg.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)digregorio(at)dndg(dot)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

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Alejandro Dubrovsky 2011-06-06 07:10:18 Re: Problem with index using regular expression
Previous Message Håvard Wahl Kongsgård 2011-06-06 07:03:58 Re: Problem with index using regular expression