Re: Find \ in text

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Christine Penner <chris(at)fp2(dot)ca>, Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Find \ in text
Date: 2010-09-07 22:15:45
Message-ID: 4C86B991.6000802@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/07/10 2:44 PM, Steve Crawford wrote:
>> Any other suggestions?
>
> ... like E'%\\\\%'
>

and, for extra fun, if that SQL statement is a constant string in a C or
similar programming language, you may well need to double up those \'s
again so that SQL sees them as the C/C++/etc parser itself does \ escaping.

sql_command = "select MM_PATH_FILE from MULTI_MEDIA Where
MM_PATH_FILE NOT ILIKE E'%\\\\\\\\%';"

Seriously, MS Windows programmers really really should use / for
paths... the windows API's are all perfectly happy with these. only the
command parser insists on \ as a path delimiter.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-09-07 23:27:15 Re: Empty SELECT result at simultaneous calls
Previous Message Steve Crawford 2010-09-07 21:56:48 Re: Find \ in text